fix infinite loop when error in peer resolution
parent
cb55803a59
commit
da68aec339
15
src/ir.cpp
15
src/ir.cpp
|
@ -16822,6 +16822,11 @@ static IrInstruction *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionPh
|
|||
peer_parent->done_resuming = true;
|
||||
return ira_resume(ira);
|
||||
}
|
||||
if (peer_parent != nullptr && !peer_parent->skipped && peer_parent->base.resolved_loc != nullptr &&
|
||||
type_is_invalid(peer_parent->base.resolved_loc->value.type))
|
||||
{
|
||||
return ira->codegen->invalid_instruction;
|
||||
}
|
||||
|
||||
ZigList<IrBasicBlock*> new_incoming_blocks = {0};
|
||||
ZigList<IrInstruction*> new_incoming_values = {0};
|
||||
|
@ -24789,7 +24794,15 @@ static IrInstruction *ir_analyze_instruction_end_expr(IrAnalyze *ira, IrInstruct
|
|||
return result_loc;
|
||||
|
||||
if (!was_written) {
|
||||
ir_analyze_store_ptr(ira, &instruction->base, result_loc, value);
|
||||
IrInstruction *store_ptr = ir_analyze_store_ptr(ira, &instruction->base, result_loc, value);
|
||||
if (type_is_invalid(store_ptr->value.type)) {
|
||||
instruction->result_loc->resolved_loc = ira->codegen->invalid_instruction;
|
||||
if (instruction->result_loc->id == ResultLocIdPeer) {
|
||||
reinterpret_cast<ResultLocPeer *>(instruction->result_loc)->parent->base.resolved_loc =
|
||||
ira->codegen->invalid_instruction;
|
||||
}
|
||||
return ira->codegen->invalid_instruction;
|
||||
}
|
||||
}
|
||||
|
||||
if (result_loc->value.data.x_ptr.mut == ConstPtrMutInfer) {
|
||||
|
|
Loading…
Reference in New Issue