diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2023-10-31 04:26:57 -0400 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2023-10-31 21:37:35 -0400 |
| commit | d890e817610dd75feef55c1f7983190852c622a5 (patch) | |
| tree | 679d13309da35aa957a9d20d28671d9b8673b5a1 /lib/std/Build/Step/CheckObject.zig | |
| parent | 50cdb65784937965b5871037ff40bc34d8eb14af (diff) | |
| download | zig-d890e817610dd75feef55c1f7983190852c622a5.tar.gz zig-d890e817610dd75feef55c1f7983190852c622a5.zip | |
mem: fix ub in writeInt
Use inline to vastly simplify the exposed API. This allows a
comptime-known endian parameter to be propogated, making extra functions
for a specific endianness completely unnecessary.
Diffstat (limited to 'lib/std/Build/Step/CheckObject.zig')
| -rw-r--r-- | lib/std/Build/Step/CheckObject.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/Build/Step/CheckObject.zig b/lib/std/Build/Step/CheckObject.zig index 2534298854..45a5ea541f 100644 --- a/lib/std/Build/Step/CheckObject.zig +++ b/lib/std/Build/Step/CheckObject.zig @@ -1624,8 +1624,8 @@ const WasmDumper = struct { switch (opcode) { .i32_const => try writer.print("i32.const {x}\n", .{try std.leb.readILEB128(i32, reader)}), .i64_const => try writer.print("i64.const {x}\n", .{try std.leb.readILEB128(i64, reader)}), - .f32_const => try writer.print("f32.const {x}\n", .{@as(f32, @bitCast(try reader.readIntLittle(u32)))}), - .f64_const => try writer.print("f64.const {x}\n", .{@as(f64, @bitCast(try reader.readIntLittle(u64)))}), + .f32_const => try writer.print("f32.const {x}\n", .{@as(f32, @bitCast(try reader.readInt(u32, .Little)))}), + .f64_const => try writer.print("f64.const {x}\n", .{@as(f64, @bitCast(try reader.readInt(u64, .Little)))}), .global_get => try writer.print("global.get {x}\n", .{try std.leb.readULEB128(u32, reader)}), else => unreachable, } |
