stage2: Fix assertion in struct field offset when all fields are 0-size
This commit is contained in:
committed by
Andrew Kelley
parent
34a6fcd88e
commit
54426bdc82
@@ -4786,7 +4786,7 @@ pub const Type = extern union {
|
||||
return field_offset.offset;
|
||||
}
|
||||
|
||||
return std.mem.alignForwardGeneric(u64, it.offset, it.big_align);
|
||||
return std.mem.alignForwardGeneric(u64, it.offset, @maximum(it.big_align, 1));
|
||||
},
|
||||
|
||||
.tuple, .anon_struct => {
|
||||
@@ -4809,7 +4809,7 @@ pub const Type = extern union {
|
||||
if (i == index) return offset;
|
||||
offset += field_ty.abiSize(target);
|
||||
}
|
||||
offset = std.mem.alignForwardGeneric(u64, offset, big_align);
|
||||
offset = std.mem.alignForwardGeneric(u64, offset, @maximum(big_align, 1));
|
||||
return offset;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user