diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-04-24 13:32:25 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-04-25 11:23:41 -0700 |
| commit | 747f58366a25593431a0e8ff85d76095e0e39e74 (patch) | |
| tree | 2319688341132c9d9c2496e9a5de4b0738694adb | |
| parent | a8de15f66a51d273cefa07eed0d8fd2952e92387 (diff) | |
| download | zig-747f58366a25593431a0e8ff85d76095e0e39e74.tar.gz zig-747f58366a25593431a0e8ff85d76095e0e39e74.zip | |
wasm backend: fix airMemset with slices
| -rw-r--r-- | src/arch/wasm/CodeGen.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/arch/wasm/CodeGen.zig b/src/arch/wasm/CodeGen.zig index e3f07d0606..adca406b53 100644 --- 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); |
