From 9c39d5720f4d06bf3e4f14ec50d702b50c9f0cdd Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 13 Jul 2019 18:38:52 -0400 Subject: ir: add an assertion in phi analysis --- src/ir.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index 616bb23132..5193a63ec4 100644 --- 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); -- cgit v1.2.3