authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-03-11 11:09:15-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-03-11 11:09:15-04:00
log1d5e349a52de9f4d056d50a1e41b89e7b0184a05
tree3ba6ab7e80295a12cee83117ba6b772c3829aaee
parentbcbb2650c5a7dca900861cc23f60374d29d50ec4
signaturelock-open Commit is signed but in an unrecognized format.

ir: fix handling of OnePossibleValueInvalid

this is the poison value which means a compile error has already been reported

1 files changed, 3 insertions(+), 2 deletions(-)

src/ir.cpp+3-2
...@@ -10562,8 +10562,9 @@ static IrInstruction *ir_analyze_enum_to_union(IrAnalyze *ira, IrInstruction *so...@@ -10562,8 +10562,9 @@ static IrInstruction *ir_analyze_enum_to_union(IrAnalyze *ira, IrInstruction *so
10562 return ira->codegen->invalid_instruction;10562 return ira->codegen->invalid_instruction;
1056310563
10564 switch (type_has_one_possible_value(ira->codegen, union_field->type_entry)) {10564 switch (type_has_one_possible_value(ira->codegen, union_field->type_entry)) {
10565 case OnePossibleValueNo:10565 case OnePossibleValueInvalid:
10566 case OnePossibleValueInvalid: {10566 return ira->codegen->invalid_instruction;
10567 case OnePossibleValueNo: {
10567 AstNode *field_node = wanted_type->data.unionation.decl_node->data.container_decl.fields.at(10568 AstNode *field_node = wanted_type->data.unionation.decl_node->data.container_decl.fields.at(
10568 union_field->enum_field->decl_index);10569 union_field->enum_field->decl_index);
10569 ErrorMsg *msg = ir_add_error(ira, source_instr,10570 ErrorMsg *msg = ir_add_error(ira, source_instr,