commit 2d7f0ca387898fa6fb7da7946e4ecff45058b99c (tree) parent 5a52613caf940b264bc0ed011e503ceec769200a Author: Jimmi Holst Christensen <jhc@liab.dk> Date: Fri, 8 Mar 2019 12:52:21 +0100 fixed enum to union code Diffstat:
| M | src/ir.cpp | | | 3 | +++ |
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git 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; }