| ... | @@ -9615,6 +9615,10 @@ static ZigType *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_node, ZigT | ... | @@ -9615,6 +9615,10 @@ static ZigType *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_node, ZigT |
| 9615 | return cur_type; | 9615 | return cur_type; |
| 9616 | } | 9616 | } |
| 9617 | | 9617 | |
| | 9618 | if (prev_type == cur_type) { |
| | 9619 | continue; |
| | 9620 | } |
| | 9621 | |
| 9618 | if (prev_type->id == ZigTypeIdUnreachable) { | 9622 | if (prev_type->id == ZigTypeIdUnreachable) { |
| 9619 | prev_inst = cur_inst; | 9623 | prev_inst = cur_inst; |
| 9620 | continue; | 9624 | continue; |
| ... | @@ -14921,7 +14925,7 @@ static IrInstruction *ir_analyze_async_call(IrAnalyze *ira, IrInstructionCallSrc | ... | @@ -14921,7 +14925,7 @@ static IrInstruction *ir_analyze_async_call(IrAnalyze *ira, IrInstructionCallSrc |
| 14921 | ZigType *frame_type = get_fn_frame_type(ira->codegen, fn_entry); | 14925 | ZigType *frame_type = get_fn_frame_type(ira->codegen, fn_entry); |
| 14922 | IrInstruction *result_loc = ir_resolve_result(ira, &call_instruction->base, call_instruction->result_loc, | 14926 | IrInstruction *result_loc = ir_resolve_result(ira, &call_instruction->base, call_instruction->result_loc, |
| 14923 | frame_type, nullptr, true, true, false); | 14927 | frame_type, nullptr, true, true, false); |
| 14924 | if (result_loc != nullptr && (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc))) { | 14928 | if (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc)) { |
| 14925 | return result_loc; | 14929 | return result_loc; |
| 14926 | } | 14930 | } |
| 14927 | result_loc = ir_implicit_cast(ira, result_loc, get_pointer_to_type(ira->codegen, frame_type, false)); | 14931 | result_loc = ir_implicit_cast(ira, result_loc, get_pointer_to_type(ira->codegen, frame_type, false)); |
| ... | @@ -15638,10 +15642,14 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c | ... | @@ -15638,10 +15642,14 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c |
| 15638 | if (handle_is_ptr(impl_fn_type_id->return_type)) { | 15642 | if (handle_is_ptr(impl_fn_type_id->return_type)) { |
| 15639 | result_loc = ir_resolve_result(ira, &call_instruction->base, call_instruction->result_loc, | 15643 | result_loc = ir_resolve_result(ira, &call_instruction->base, call_instruction->result_loc, |
| 15640 | impl_fn_type_id->return_type, nullptr, true, true, false); | 15644 | impl_fn_type_id->return_type, nullptr, true, true, false); |
| 15641 | if (result_loc != nullptr && (type_is_invalid(result_loc->value.type) || | 15645 | if (result_loc != nullptr) { |
| 15642 | instr_is_unreachable(result_loc))) | 15646 | if (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc)) { |
| 15643 | { | 15647 | return result_loc; |
| 15644 | return result_loc; | 15648 | } |
| | 15649 | if (!handle_is_ptr(result_loc->value.type->data.pointer.child_type)) { |
| | 15650 | ir_reset_result(call_instruction->result_loc); |
| | 15651 | result_loc = nullptr; |
| | 15652 | } |
| 15645 | } | 15653 | } |
| 15646 | } else { | 15654 | } else { |
| 15647 | result_loc = nullptr; | 15655 | result_loc = nullptr; |
| ... | @@ -15791,8 +15799,14 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c | ... | @@ -15791,8 +15799,14 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c |
| 15791 | if (handle_is_ptr(return_type)) { | 15799 | if (handle_is_ptr(return_type)) { |
| 15792 | result_loc = ir_resolve_result(ira, &call_instruction->base, call_instruction->result_loc, | 15800 | result_loc = ir_resolve_result(ira, &call_instruction->base, call_instruction->result_loc, |
| 15793 | return_type, nullptr, true, true, false); | 15801 | return_type, nullptr, true, true, false); |
| 15794 | if (result_loc != nullptr && (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc))) { | 15802 | if (result_loc != nullptr) { |
| 15795 | return result_loc; | 15803 | if (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc)) { |
| | 15804 | return result_loc; |
| | 15805 | } |
| | 15806 | if (!handle_is_ptr(result_loc->value.type->data.pointer.child_type)) { |
| | 15807 | ir_reset_result(call_instruction->result_loc); |
| | 15808 | result_loc = nullptr; |
| | 15809 | } |
| 15796 | } | 15810 | } |
| 15797 | } else { | 15811 | } else { |
| 15798 | result_loc = nullptr; | 15812 | result_loc = nullptr; |