diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-11-26 04:03:39 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-11-26 04:03:39 -0500 |
| commit | 697c768730ad4c095c376079adbb97854db84cb9 (patch) | |
| tree | aee759024d7e31fce2c70b076b0574848d605b95 /src/ir.cpp | |
| parent | bbf785bc1d5740488521b0cb90eeae31090e67ae (diff) | |
| download | zig-697c768730ad4c095c376079adbb97854db84cb9.tar.gz zig-697c768730ad4c095c376079adbb97854db84cb9.zip | |
IR: support switch with range
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 605574d6cc..0ada1aea36 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -630,6 +630,7 @@ static IrInstruction *ir_build_phi(IrBuilder *irb, AstNode *source_node, phi_instruction->incoming_values = incoming_values; for (size_t i = 0; i < incoming_count; i += 1) { + ir_ref_bb(incoming_blocks[i]); ir_ref_instruction(incoming_values[i]); } @@ -2784,8 +2785,8 @@ static void ir_start_bb(IrAnalyze *ira, IrBasicBlock *old_bb, IrBasicBlock *cons ira->old_irb.current_basic_block = old_bb; ira->const_predecessor_bb = const_predecessor_bb; - assert(old_bb->other); - ira->new_irb.exec->basic_block_list.append(old_bb->other); + if (old_bb->other) + ira->new_irb.exec->basic_block_list.append(old_bb->other); } static void ir_finish_bb(IrAnalyze *ira) { |
