diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-03-11 11:09:15 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-03-11 11:09:15 -0400 |
| commit | 1d5e349a52de9f4d056d50a1e41b89e7b0184a05 (patch) | |
| tree | 3ba6ab7e80295a12cee83117ba6b772c3829aaee /src/ir.cpp | |
| parent | bcbb2650c5a7dca900861cc23f60374d29d50ec4 (diff) | |
| download | zig-1d5e349a52de9f4d056d50a1e41b89e7b0184a05.tar.gz zig-1d5e349a52de9f4d056d50a1e41b89e7b0184a05.zip | |
ir: fix handling of OnePossibleValueInvalid
this is the poison value which means a compile error has
already been reported
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index e8306913f9..7d5a5305b1 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -10562,8 +10562,9 @@ static IrInstruction *ir_analyze_enum_to_union(IrAnalyze *ira, IrInstruction *so return ira->codegen->invalid_instruction; switch (type_has_one_possible_value(ira->codegen, union_field->type_entry)) { - case OnePossibleValueNo: - case OnePossibleValueInvalid: { + case OnePossibleValueInvalid: + return ira->codegen->invalid_instruction; + case OnePossibleValueNo: { AstNode *field_node = wanted_type->data.unionation.decl_node->data.container_decl.fields.at( union_field->enum_field->decl_index); ErrorMsg *msg = ir_add_error(ira, source_instr, |
