commit 747f58366a25593431a0e8ff85d76095e0e39e74 (tree)
parent a8de15f66a51d273cefa07eed0d8fd2952e92387
Author: Andrew Kelley <andrew@ziglang.org>
Date: Mon, 24 Apr 2023 13:32:25 -0700
wasm backend: fix airMemset with slices
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/arch/wasm/CodeGen.zig b/src/arch/wasm/CodeGen.zig
@@ -4392,7 +4392,7 @@ fn airMemset(func: *CodeGen, inst: Air.Inst.Index) InnerError!void {
const value = try func.resolveInst(bin_op.rhs);
const len = switch (ptr_ty.ptrSize()) {
.Slice => try func.sliceLen(ptr),
- .One => @as(WValue, .{ .imm64 = ptr_ty.childType().arrayLen() }),
+ .One => @as(WValue, .{ .imm32 = @intCast(u32, ptr_ty.childType().arrayLen()) }),
.C, .Many => unreachable,
};
try func.memset(ptr, len, value);