Commit 9965d960b5

mlugg <mlugg@mlugg.co.uk>
2023-09-21 22:36:31
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.
1 parent d3f3de7
Changed files (1)
src/type.zig
@@ -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" };
                         }
                     }