aboutsummaryrefslogtreecommitdiff
path: root/src/arch/wasm/CodeGen.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/wasm/CodeGen.zig')
-rw-r--r--src/arch/wasm/CodeGen.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/arch/wasm/CodeGen.zig b/src/arch/wasm/CodeGen.zig
index d0ff27a3e2..c0d0c11b56 100644
--- a/src/arch/wasm/CodeGen.zig
+++ b/src/arch/wasm/CodeGen.zig
@@ -3880,8 +3880,11 @@ fn isNull(func: *CodeGen, operand: WValue, optional_ty: Type, opcode: wasm.Opcod
try func.addMemArg(.i32_load8_u, .{ .offset = operand.offset(), .alignment = 1 });
}
} else if (payload_ty.isSlice()) {
- // move the ptr on top of the stack
- _ = try func.load(operand, Type.usize, 0);
+ switch (func.arch()) {
+ .wasm32 => try func.addMemArg(.i32_load, .{ .offset = operand.offset(), .alignment = 4 }),
+ .wasm64 => try func.addMemArg(.i64_load, .{ .offset = operand.offset(), .alignment = 8 }),
+ else => unreachable,
+ }
}
// Compare the null value with '0'