diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-07-13 18:38:52 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-07-13 18:38:52 -0400 |
| commit | 9c39d5720f4d06bf3e4f14ec50d702b50c9f0cdd (patch) | |
| tree | 8032e86cb0955d6c42b7eab4b0ae6d8a014c0a84 /src/ir.cpp | |
| parent | c0489abcdbad82c95e332e5c7f9982b368a441f0 (diff) | |
| download | zig-9c39d5720f4d06bf3e4f14ec50d702b50c9f0cdd.tar.gz zig-9c39d5720f4d06bf3e4f14ec50d702b50c9f0cdd.zip | |
ir: add an assertion in phi analysis
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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); |
