From 9965d960b594dcdc67b356201eba57db38be24f5 Mon Sep 17 00:00:00 2001 From: mlugg Date: Thu, 21 Sep 2023 21:36:31 +0100 Subject: [PATCH] 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. --- src/type.zig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/type.zig b/src/type.zig index 067c38b6b0..a42f7dd4ee 100644 --- a/src/type.zig +++ b/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" }; } }