type: give empty unions 1-byte alignment

Zero-byte alignment is no longer valid for runtime types. I made most of
these changes in an earlier commit, but missed this case.
This commit is contained in:
mlugg 2023-09-21 21:36:31 +01:00 committed by Andrew Kelley
parent d3f3de73ba
commit 9965d960b5

View File

@ -1051,9 +1051,7 @@ pub const Type = struct {
if (union_obj.hasTag(ip)) {
return abiAlignmentAdvanced(union_obj.enum_tag_ty.toType(), mod, strat);
} else {
return .{
.scalar = Alignment.fromByteUnits(@intFromBool(union_obj.flagsPtr(ip).layout == .Extern)),
};
return .{ .scalar = .@"1" };
}
}