mirror of
https://github.com/ziglang/zig.git
synced 2026-02-01 04:03:40 +00:00
wasm backend: fix airMemset with slices
This commit is contained in:
parent
a8de15f66a
commit
747f58366a
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user