diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-12-30 18:47:54 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-12-30 18:47:54 -0500 |
| commit | 29bb175f4f9018bfb0e17686c05165527530de25 (patch) | |
| tree | 921bcfaf01fb3fb9cb1918d14e3b11e303dc1986 /src/ir.cpp | |
| parent | 6bbee194b9e8740e99dad537a6a236bd3142bbae (diff) | |
| download | zig-29bb175f4f9018bfb0e17686c05165527530de25.tar.gz zig-29bb175f4f9018bfb0e17686c05165527530de25.zip | |
IR: handle phi instruction with 0 resulting incoming values
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 4f3a686ba4..edb2789c5d 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -7938,7 +7938,11 @@ static TypeTableEntry *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionP new_incoming_blocks.append(predecessor->other); new_incoming_values.append(new_value); } - assert(new_incoming_blocks.length != 0); + + if (new_incoming_blocks.length == 0) { + ir_build_const_from(ira, &phi_instruction->base, false); + return ira->codegen->builtin_types.entry_void; + } if (new_incoming_blocks.length == 1) { IrInstruction *first_value = new_incoming_values.at(0); |
