authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-12-30 18:47:54-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-12-30 18:47:54-05:00
log29bb175f4f9018bfb0e17686c05165527530de25
tree921bcfaf01fb3fb9cb1918d14e3b11e303dc1986
parent6bbee194b9e8740e99dad537a6a236bd3142bbae

IR: handle phi instruction with 0 resulting incoming values


1 files changed, 5 insertions(+), 1 deletions(-)

src/ir.cpp+5-1
...@@ -7938,7 +7938,11 @@ static TypeTableEntry *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionP...@@ -7938,7 +7938,11 @@ static TypeTableEntry *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionP
7938 new_incoming_blocks.append(predecessor->other);7938 new_incoming_blocks.append(predecessor->other);
7939 new_incoming_values.append(new_value);7939 new_incoming_values.append(new_value);
7940 }7940 }
7941 assert(new_incoming_blocks.length != 0);7941
7942 if (new_incoming_blocks.length == 0) {
7943 ir_build_const_from(ira, &phi_instruction->base, false);
7944 return ira->codegen->builtin_types.entry_void;
7945 }
79427946
7943 if (new_incoming_blocks.length == 1) {7947 if (new_incoming_blocks.length == 1) {
7944 IrInstruction *first_value = new_incoming_values.at(0);7948 IrInstruction *first_value = new_incoming_values.at(0);