ir: add an assertion in phi analysis

master
Andrew Kelley 2019-07-13 18:38:52 -04:00
parent c0489abcdb
commit 9c39d5720f
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
1 changed files with 1 additions and 0 deletions

View File

@ -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);