Commit f0fe55a9bb

Andrew Kelley <andrew@ziglang.org>
2025-09-06 07:52:30
frontend: fix too strict assertion
field ptr can be based on C pointer
1 parent f12c4f8
Changed files (1)
src/Value.zig
@@ -2222,7 +2222,7 @@ pub fn ptrField(parent_ptr: Value, field_idx: u32, pt: Zcu.PerThread) !Value {
     const aggregate_ty = parent_ptr_ty.childType(zcu);
 
     const parent_ptr_info = parent_ptr_ty.ptrInfo(zcu);
-    assert(parent_ptr_info.flags.size == .one);
+    assert(parent_ptr_info.flags.size == .one or parent_ptr_info.flags.size == .c);
 
     // Exiting this `switch` indicates that the `field` pointer representation should be used.
     // `field_align` may be `.none` to represent the natural alignment of `field_ty`, but is not necessarily.