fixed enum to union code

master
Jimmi Holst Christensen 2019-03-08 12:52:21 +01:00 committed by Andrew Kelley
parent 5a52613caf
commit 2d7f0ca387
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
1 changed files with 3 additions and 0 deletions

View File

@ -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;
}