aboutsummaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2023-05-31 04:42:18 +0100
committerAndrew Kelley <andrew@ziglang.org>2023-06-10 20:47:57 -0700
commita0d4ef0acf50db06fdde8ff229d20d15afc7d402 (patch)
tree92b320040e5a979d569a5284e71c6fcdf7ee893f /src/arch
parent99531b0d52392668fe9f86b5109fff74cd37aff3 (diff)
downloadzig-a0d4ef0acf50db06fdde8ff229d20d15afc7d402.tar.gz
zig-a0d4ef0acf50db06fdde8ff229d20d15afc7d402.zip
InternPool: add representation for value of empty enums and unions
This is a bit odd, because this value doesn't actually exist: see #15909. This gets all the empty enum/union behavior tests passing. Also adds an assertion to `Sema.analyzeBodyInner` which would have helped figure out the issue here much more quickly.
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/wasm/CodeGen.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/arch/wasm/CodeGen.zig b/src/arch/wasm/CodeGen.zig
index e397cf29f8..e92bd8f676 100644
--- a/src/arch/wasm/CodeGen.zig
+++ b/src/arch/wasm/CodeGen.zig
@@ -3156,6 +3156,7 @@ fn lowerConstant(func: *CodeGen, arg_val: Value, ty: Type) InnerError!WValue {
.extern_func,
.func,
.enum_literal,
+ .empty_enum_value,
=> unreachable, // non-runtime values
.int => {
const int_info = ty.intInfo(mod);