| ... | @@ -4122,8 +4122,14 @@ static LLVMValueRef ir_render_call(CodeGen *g, IrExecutable *executable, IrInstr | ... | @@ -4122,8 +4122,14 @@ static LLVMValueRef ir_render_call(CodeGen *g, IrExecutable *executable, IrInstr |
| 4122 | if (!type_has_bits(src_return_type)) | 4122 | if (!type_has_bits(src_return_type)) |
| 4123 | return nullptr; | 4123 | return nullptr; |
| 4124 | | 4124 | |
| 4125 | if (result_loc != nullptr) | 4125 | if (result_loc != nullptr) { |
| 4126 | return get_handle_value(g, result_loc, src_return_type, ptr_result_type); | 4126 | if (instruction->result_loc->id == IrInstructionIdReturnPtr) { |
| | 4127 | instruction->base.spill = nullptr; |
| | 4128 | return g->cur_ret_ptr; |
| | 4129 | } else { |
| | 4130 | return get_handle_value(g, result_loc, src_return_type, ptr_result_type); |
| | 4131 | } |
| | 4132 | } |
| 4127 | | 4133 | |
| 4128 | LLVMValueRef result_ptr = LLVMBuildStructGEP(g->builder, frame_result_loc, frame_ret_start + 2, ""); | 4134 | LLVMValueRef result_ptr = LLVMBuildStructGEP(g->builder, frame_result_loc, frame_ret_start + 2, ""); |
| 4129 | return LLVMBuildLoad(g->builder, result_ptr, ""); | 4135 | return LLVMBuildLoad(g->builder, result_ptr, ""); |