aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2023-06-24 17:01:46 +0100
committerAndrew Kelley <andrew@ziglang.org>2023-06-24 16:56:40 -0700
commit67997a699a4a1ee20fb189f38077a4bb29c096b3 (patch)
tree0053cd5ea2ab1839e7e271693e78e314dae9c32d /src
parenta84a8953257ccfb70567a75017c98830eca250e3 (diff)
downloadzig-67997a699a4a1ee20fb189f38077a4bb29c096b3.tar.gz
zig-67997a699a4a1ee20fb189f38077a4bb29c096b3.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/codegen/c.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index 317d77602f..fb4e619e9e 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -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);
}