Commit 747f58366a

Andrew Kelley <andrew@ziglang.org>
2023-04-24 22:32:25
wasm backend: fix airMemset with slices
1 parent a8de15f
Changed files (1)
src
arch
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);