diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-11-16 10:06:58 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-11-16 10:06:58 -0500 |
| commit | f12d36641f67564d2103f75ed7a5445219197db5 (patch) | |
| tree | 63f967ea88d81475466fbc00929e05d8fe1ec2a3 /src/ir.cpp | |
| parent | 018cbff438cedc19d0ad18021619ec7ede997307 (diff) | |
| download | zig-f12d36641f67564d2103f75ed7a5445219197db5.tar.gz zig-f12d36641f67564d2103f75ed7a5445219197db5.zip | |
union secret field is the tag index instead of distinct type index
See #144
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 6df6b4f828..fa59aa03f2 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -13158,7 +13158,8 @@ static TypeTableEntry *ir_analyze_container_init_fields_union(IrAnalyze *ira, Ir return ira->codegen->builtin_types.entry_invalid; ConstExprValue *out_val = ir_build_const_from(ira, instruction); - out_val->data.x_union.value = field_val; + out_val->data.x_union.payload = field_val; + out_val->data.x_union.tag = type_field->value; ConstParent *parent = get_const_val_parent(ira->codegen, field_val); if (parent != nullptr) { |
