authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2023-06-24 17:01:46+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-24 16:56:40-07:00
log67997a699a4a1ee20fb189f38077a4bb29c096b3
tree0053cd5ea2ab1839e7e271693e78e314dae9c32d
parenta84a8953257ccfb70567a75017c98830eca250e3

cbe: codegen int_from_ptr of slice correctly

CBE was translating to access the `len` field rather than `ptr`. Air.zig specifies that this operation is valid on a slice.

1 files changed, 1 insertions(+), 1 deletions(-)

src/codegen/c.zig+1-1
......@@ -5855,7 +5855,7 @@ fn airIntFromPtr(f: *Function, inst: Air.Inst.Index) !CValue {
58555855 try f.renderType(writer, inst_ty);
58565856 try writer.writeByte(')');
58575857 if (operand_ty.isSlice(mod)) {
5858 try f.writeCValueMember(writer, operand, .{ .identifier = "len" });
5858 try f.writeCValueMember(writer, operand, .{ .identifier = "ptr" });
58595859 } else {
58605860 try f.writeCValue(writer, operand, .Other);
58615861 }