authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-09-05 22:52:30-07:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-09-21 21:08:52+02:00
log4d102751b6346cf614699f0a830fb5a2c1ee9f66
treefd377b0b8c1ba1d555031e4296c84fa8269a0e26
parent3ab845e028f464666856e4eaaeff2e6ab1b3da5d
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

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 {
22222222 const aggregate_ty = parent_ptr_ty.childType(zcu);
22232223
22242224 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
22272227 // Exiting this `switch` indicates that the `field` pointer representation should be used.
22282228 // `field_align` may be `.none` to represent the natural alignment of `field_ty`, but is not necessarily.