Skip to content

Commit 8e836cb

Browse files
committed
wasm: correctly lower signed value in @tagName
1 parent a9b37ac commit 8e836cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/arch/wasm/CodeGen.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7215,12 +7215,12 @@ fn getTagNameFunction(func: *CodeGen, enum_ty: Type) InnerError!u32 {
72157215
switch (tag_value) {
72167216
.imm32 => |value| {
72177217
try writer.writeByte(std.wasm.opcode(.i32_const));
7218-
try leb.writeULEB128(writer, value);
7218+
try leb.writeILEB128(writer, @as(i32, @bitCast(value)));
72197219
try writer.writeByte(std.wasm.opcode(.i32_ne));
72207220
},
72217221
.imm64 => |value| {
72227222
try writer.writeByte(std.wasm.opcode(.i64_const));
7223-
try leb.writeULEB128(writer, value);
7223+
try leb.writeILEB128(writer, @as(i64, @bitCast(value)));
72247224
try writer.writeByte(std.wasm.opcode(.i64_ne));
72257225
},
72267226
else => unreachable,

0 commit comments

Comments
 (0)