@@ -28617,7 +28617,8 @@ fn tupleFieldPtr(
2861728617 const pt = sema.pt;
2861828618 const zcu = pt.zcu;
2861928619 const tuple_ptr_ty = sema.typeOf(tuple_ptr);
28620- const tuple_ty = tuple_ptr_ty.childType(zcu);
28620+ const tuple_ptr_info = tuple_ptr_ty.ptrInfo(zcu);
28621+ const tuple_ty: Type = .fromInterned(tuple_ptr_info.child);
2862128622 try tuple_ty.resolveFields(pt);
2862228623 const field_count = tuple_ty.structFieldCount(zcu);
2862328624
@@ -28635,9 +28636,16 @@ fn tupleFieldPtr(
2863528636 const ptr_field_ty = try pt.ptrTypeSema(.{
2863628637 .child = field_ty.toIntern(),
2863728638 .flags = .{
28638- .is_const = !tuple_ptr_ty.ptrIsMutable(zcu),
28639- .is_volatile = tuple_ptr_ty.isVolatilePtr(zcu),
28640- .address_space = tuple_ptr_ty.ptrAddressSpace(zcu),
28639+ .is_const = tuple_ptr_info.flags.is_const,
28640+ .is_volatile = tuple_ptr_info.flags.is_volatile,
28641+ .address_space = tuple_ptr_info.flags.address_space,
28642+ .alignment = a: {
28643+ if (tuple_ptr_info.flags.alignment == .none) break :a .none;
28644+ // The tuple pointer isn't naturally aligned, so the field pointer might be underaligned.
28645+ const tuple_align = tuple_ptr_info.flags.alignment;
28646+ const field_align = try field_ty.abiAlignmentSema(pt);
28647+ break :a tuple_align.min(field_align);
28648+ },
2864128649 },
2864228650 });
2864328651
0 commit comments