commit 9c39d5720f4d06bf3e4f14ec50d702b50c9f0cdd (tree)
parent c0489abcdbad82c95e332e5c7f9982b368a441f0
Author: Andrew Kelley <andrew@ziglang.org>
Date: Sat, 13 Jul 2019 18:38:52 -0400
ir: add an assertion in phi analysis
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/src/ir.cpp b/src/ir.cpp
@@ -17129,6 +17129,7 @@ static IrInstruction *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionPh
for (size_t i = 0; i < new_incoming_values.length; i += 1) {
IrInstruction *new_value = new_incoming_values.at(i);
IrBasicBlock *predecessor = new_incoming_blocks.at(i);
+ ir_assert(predecessor->instruction_list.length != 0, &phi_instruction->base);
IrInstruction *branch_instruction = predecessor->instruction_list.pop();
ir_set_cursor_at_end(&ira->new_irb, predecessor);
IrInstruction *casted_value = ir_implicit_cast(ira, new_value, resolved_type);