aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorJimmi Holst Christensen <jhc@liab.dk>2019-03-08 12:52:21 +0100
committerAndrew Kelley <andrew@ziglang.org>2019-03-11 10:55:10 -0400
commit2d7f0ca387898fa6fb7da7946e4ecff45058b99c (patch)
tree32ef3a7eb2ae6c687e495d13b907ae7883c5ec82 /src/ir.cpp
parent5a52613caf940b264bc0ed011e503ceec769200a (diff)
downloadzig-2d7f0ca387898fa6fb7da7946e4ecff45058b99c.tar.gz
zig-2d7f0ca387898fa6fb7da7946e4ecff45058b99c.zip
fixed enum to union code
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 462c07959f..486a8ec4f3 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -10576,6 +10576,9 @@ static IrInstruction *ir_analyze_enum_to_union(IrAnalyze *ira, IrInstruction *so
result->value.special = ConstValSpecialStatic;
result->value.type = wanted_type;
bigint_init_bigint(&result->value.data.x_union.tag, &val->data.x_enum_tag);
+ result->value.data.x_union.payload = create_const_vals(1);
+ result->value.data.x_union.payload->special = ConstValSpecialStatic;
+ result->value.data.x_union.payload->type = union_field->type_entry;
return result;
}