mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 21:38:33 +00:00
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.
This commit is contained in:
parent
a84a895325
commit
67997a699a
@ -5855,7 +5855,7 @@ fn airIntFromPtr(f: *Function, inst: Air.Inst.Index) !CValue {
|
||||
try f.renderType(writer, inst_ty);
|
||||
try writer.writeByte(')');
|
||||
if (operand_ty.isSlice(mod)) {
|
||||
try f.writeCValueMember(writer, operand, .{ .identifier = "len" });
|
||||
try f.writeCValueMember(writer, operand, .{ .identifier = "ptr" });
|
||||
} else {
|
||||
try f.writeCValue(writer, operand, .Other);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user