From d62229e3ad6069597b74874ba3b84fc185b2fa4c Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 26 Feb 2022 15:35:46 -0700 Subject: Sema: Module.Union.abiAlignment can return 0 When the union is a 0-bit type. --- src/Module.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Module.zig') diff --git a/src/Module.zig b/src/Module.zig index 7f52dc23e9..91386405be 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -1210,6 +1210,7 @@ pub const Union = struct { return @intCast(u32, most_index); } + /// Returns 0 if the union is represented with 0 bits at runtime. pub fn abiAlignment(u: Union, target: Target, have_tag: bool) u32 { var max_align: u32 = 0; if (have_tag) max_align = u.tag_ty.abiAlignment(target); @@ -1225,7 +1226,6 @@ pub const Union = struct { }; max_align = @maximum(max_align, field_align); } - assert(max_align != 0); return max_align; } -- cgit v1.2.3