aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-02-26 15:35:46 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-02-26 16:53:23 -0700
commitd62229e3ad6069597b74874ba3b84fc185b2fa4c (patch)
treef2618b8263edb55fd0fd4c6cebaa9890b4b5838d /src/Module.zig
parent822d29286bd39b7331970e1e641ad240e7b62aee (diff)
downloadzig-d62229e3ad6069597b74874ba3b84fc185b2fa4c.tar.gz
zig-d62229e3ad6069597b74874ba3b84fc185b2fa4c.zip
Sema: Module.Union.abiAlignment can return 0
When the union is a 0-bit type.
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig2
1 files changed, 1 insertions, 1 deletions
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;
}