| ... | ... | @@ -1,5 +1,3 @@ |
| 1 | | //! Minimal UBSan Runtime |
| 2 | | |
| 3 | 1 | const std = @import("std"); |
| 4 | 2 | const builtin = @import("builtin"); |
| 5 | 3 | const assert = std.debug.assert; |
| ... | ... | @@ -471,7 +469,7 @@ fn floatCastOverflow( |
| 471 | 469 | // See: https://github.com/llvm/llvm-project/blob/release/19.x/compiler-rt/lib/ubsan/ubsan_handlers.cpp#L463 |
| 472 | 470 | // for more information on this check. |
| 473 | 471 | const ptr: [*]const u8 = @ptrCast(data_handle); |
| 474 | | if (ptr[0] + ptr[1] < 2 or ptr[0] == 0xFF or ptr[1] == 0xFF) { |
| 472 | if (@as(u16, ptr[0]) + @as(u16, ptr[1]) < 2 or ptr[0] == 0xFF or ptr[1] == 0xFF) { |
| 475 | 473 | const data: *const FloatCastOverflowData = @ptrCast(data_handle); |
| 476 | 474 | const from_value: Value = .{ .handle = from_handle, .type_descriptor = data.from }; |
| 477 | 475 | logMessage("{} is outside the range of representable values of type {s}", .{ |