| author | |
| committer | |
| log | b93fa9833e6d2f7959eabb2417a154152a8d2d1c |
| tree | 4ba806a2ca4684d1ae4db0c2e9f55eabcdca53c3 |
| parent | 061d99285d5a73a71a97ed7bbb45f0a7f65acf2d |
| signature | Commit is signed but in an unrecognized format. |
Previously we would use the address of the slice itself, which would
result in miscompilations and accidently setting the memory region
of the slice itself, rather than based on the `ptr` field.1 files changed, 3 insertions(+), 1 deletions(-)
src/arch/wasm/CodeGen.zig+3-1| ... | ... | @@ -4464,7 +4464,9 @@ fn airMemset(func: *CodeGen, inst: Air.Inst.Index, safety: bool) InnerError!void |
| 4464 | 4464 | .One => @as(WValue, .{ .imm32 = @intCast(u32, ptr_ty.childType().arrayLen()) }), |
| 4465 | 4465 | .C, .Many => unreachable, |
| 4466 | 4466 | }; |
| 4467 | try func.memset(ptr, len, value); | |
| 4467 | ||
| 4468 | const dst_ptr = try func.sliceOrArrayPtr(ptr, ptr_ty); | |
| 4469 | try func.memset(dst_ptr, len, value); | |
| 4468 | 4470 | |
| 4469 | 4471 | func.finishAir(inst, .none, &.{ bin_op.lhs, bin_op.rhs }); |
| 4470 | 4472 | } |