| ... | @@ -15289,6 +15289,21 @@ static IrInstruction *ir_analyze_instruction_resolve_result(IrAnalyze *ira, IrIn | ... | @@ -15289,6 +15289,21 @@ static IrInstruction *ir_analyze_instruction_resolve_result(IrAnalyze *ira, IrIn |
| 15289 | if (result_loc != nullptr) | 15289 | if (result_loc != nullptr) |
| 15290 | return result_loc; | 15290 | return result_loc; |
| 15291 | | 15291 | |
| | 15292 | ZigFn *fn = exec_fn_entry(ira->new_irb.exec); |
| | 15293 | if (fn != nullptr && fn->type_entry->data.fn.fn_type_id.cc == CallingConventionAsync && |
| | 15294 | instruction->result_loc->id == ResultLocIdReturn) |
| | 15295 | { |
| | 15296 | result_loc = ir_resolve_result(ira, &instruction->base, no_result_loc(), |
| | 15297 | implicit_elem_type, nullptr, false, true); |
| | 15298 | if (result_loc != nullptr && |
| | 15299 | (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc))) |
| | 15300 | { |
| | 15301 | return result_loc; |
| | 15302 | } |
| | 15303 | result_loc->value.special = ConstValSpecialRuntime; |
| | 15304 | return result_loc; |
| | 15305 | } |
| | 15306 | |
| 15292 | IrInstruction *result = ir_const(ira, &instruction->base, implicit_elem_type); | 15307 | IrInstruction *result = ir_const(ira, &instruction->base, implicit_elem_type); |
| 15293 | result->value.special = ConstValSpecialUndef; | 15308 | result->value.special = ConstValSpecialUndef; |
| 15294 | IrInstruction *ptr = ir_get_ref(ira, &instruction->base, result, false, false); | 15309 | IrInstruction *ptr = ir_get_ref(ira, &instruction->base, result, false, false); |
| ... | @@ -16128,7 +16143,9 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c | ... | @@ -16128,7 +16143,9 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c |
| 16128 | if (handle_is_ptr(impl_fn_type_id->return_type)) { | 16143 | if (handle_is_ptr(impl_fn_type_id->return_type)) { |
| 16129 | result_loc = ir_resolve_result(ira, &call_instruction->base, call_instruction->result_loc, | 16144 | result_loc = ir_resolve_result(ira, &call_instruction->base, call_instruction->result_loc, |
| 16130 | impl_fn_type_id->return_type, nullptr, true, true); | 16145 | impl_fn_type_id->return_type, nullptr, true, true); |
| 16131 | if (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc)) { | 16146 | if (result_loc != nullptr && (type_is_invalid(result_loc->value.type) || |
| | 16147 | instr_is_unreachable(result_loc))) |
| | 16148 | { |
| 16132 | return result_loc; | 16149 | return result_loc; |
| 16133 | } | 16150 | } |
| 16134 | } else { | 16151 | } else { |
| ... | @@ -16248,7 +16265,7 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c | ... | @@ -16248,7 +16265,7 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c |
| 16248 | if (handle_is_ptr(return_type)) { | 16265 | if (handle_is_ptr(return_type)) { |
| 16249 | result_loc = ir_resolve_result(ira, &call_instruction->base, call_instruction->result_loc, | 16266 | result_loc = ir_resolve_result(ira, &call_instruction->base, call_instruction->result_loc, |
| 16250 | return_type, nullptr, true, true); | 16267 | return_type, nullptr, true, true); |
| 16251 | if (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc)) { | 16268 | if (result_loc != nullptr && (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc))) { |
| 16252 | return result_loc; | 16269 | return result_loc; |
| 16253 | } | 16270 | } |
| 16254 | } else { | 16271 | } else { |