authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-09-05 22:52:30-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-09-20 18:33:00-07:00
logf0fe55a9bb79118b632193dd5ad1c4a43e2f98e8
treeebf8e9d845623ecc85299614eb7f9b1d36edd7dc
parentf12c4f86fc5e46d24c511614759ee26a5ac07f3c

frontend: fix too strict assertion

field ptr can be based on C pointer

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

src/Value.zig+1-1
...@@ -2222,7 +2222,7 @@ pub fn ptrField(parent_ptr: Value, field_idx: u32, pt: Zcu.PerThread) !Value {...@@ -2222,7 +2222,7 @@ pub fn ptrField(parent_ptr: Value, field_idx: u32, pt: Zcu.PerThread) !Value {
2222 const aggregate_ty = parent_ptr_ty.childType(zcu);2222 const aggregate_ty = parent_ptr_ty.childType(zcu);
22232223
2224 const parent_ptr_info = parent_ptr_ty.ptrInfo(zcu);2224 const parent_ptr_info = parent_ptr_ty.ptrInfo(zcu);
2225 assert(parent_ptr_info.flags.size == .one);2225 assert(parent_ptr_info.flags.size == .one or parent_ptr_info.flags.size == .c);
22262226
2227 // Exiting this `switch` indicates that the `field` pointer representation should be used.2227 // Exiting this `switch` indicates that the `field` pointer representation should be used.
2228 // `field_align` may be `.none` to represent the natural alignment of `field_ty`, but is not necessarily.2228 // `field_align` may be `.none` to represent the natural alignment of `field_ty`, but is not necessarily.