authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-11-26 23:24:43-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-11-26 23:24:43-05:00
logb3ff28189ce8f28abf077dcf343d0d95bf5645c3
tree8154baa2baef99e28180464138b33b481d983128
parenta52ede6494d44865fcf05591eaf5715d8bd1dc4a

IR: fix crash when duplicate label error


1 files changed, 5 insertions(+), 4 deletions(-)

src/ir.cpp+5-4
......@@ -2640,15 +2640,16 @@ IrInstruction *ir_gen(CodeGen *codegen, AstNode *node, BlockContext *scope, IrEx
26402640
26412641 IrInstruction *result = ir_gen_node_extra(irb, node, scope, LValPurposeNone);
26422642 assert(result);
2643 if (irb->exec->invalid)
2644 return codegen->invalid_instruction;
26432645
26442646 IrInstruction *return_instruction = ir_build_return(irb, result->source_node, result);
26452647 assert(return_instruction);
26462648
2647 if (result == codegen->invalid_instruction)
2648 return codegen->invalid_instruction;
2649
2650 if (!ir_goto_pass2(irb))
2649 if (!ir_goto_pass2(irb)) {
2650 irb->exec->invalid = true;
26512651 return codegen->invalid_instruction;
2652 }
26522653
26532654 return return_instruction;
26542655}