| ... | @@ -5018,6 +5018,12 @@ static LLVMValueRef ir_render_ref(CodeGen *g, IrExecutableGen *executable, IrIns | ... | @@ -5018,6 +5018,12 @@ static LLVMValueRef ir_render_ref(CodeGen *g, IrExecutableGen *executable, IrIns |
| 5018 | if (!type_has_bits(instruction->base.value->type)) { | 5018 | if (!type_has_bits(instruction->base.value->type)) { |
| 5019 | return nullptr; | 5019 | return nullptr; |
| 5020 | } | 5020 | } |
| | 5021 | if (instruction->operand->id == IrInstGenIdCall) { |
| | 5022 | IrInstGenCall *call = reinterpret_cast<IrInstGenCall *>(instruction->operand); |
| | 5023 | if (call->result_loc != nullptr) { |
| | 5024 | return ir_llvm_value(g, call->result_loc); |
| | 5025 | } |
| | 5026 | } |
| 5021 | LLVMValueRef value = ir_llvm_value(g, instruction->operand); | 5027 | LLVMValueRef value = ir_llvm_value(g, instruction->operand); |
| 5022 | if (handle_is_ptr(instruction->operand->value->type)) { | 5028 | if (handle_is_ptr(instruction->operand->value->type)) { |
| 5023 | return value; | 5029 | return value; |
| ... | @@ -6533,7 +6539,7 @@ static void ir_render(CodeGen *g, ZigFn *fn_entry) { | ... | @@ -6533,7 +6539,7 @@ static void ir_render(CodeGen *g, ZigFn *fn_entry) { |
| 6533 | set_debug_location(g, instruction); | 6539 | set_debug_location(g, instruction); |
| 6534 | } | 6540 | } |
| 6535 | instruction->llvm_value = ir_render_instruction(g, executable, instruction); | 6541 | instruction->llvm_value = ir_render_instruction(g, executable, instruction); |
| 6536 | if (instruction->spill != nullptr) { | 6542 | if (instruction->spill != nullptr && instruction->llvm_value != nullptr) { |
| 6537 | LLVMValueRef spill_ptr = ir_llvm_value(g, instruction->spill); | 6543 | LLVMValueRef spill_ptr = ir_llvm_value(g, instruction->spill); |
| 6538 | gen_assign_raw(g, spill_ptr, instruction->spill->value->type, instruction->llvm_value); | 6544 | gen_assign_raw(g, spill_ptr, instruction->spill->value->type, instruction->llvm_value); |
| 6539 | instruction->llvm_value = nullptr; | 6545 | instruction->llvm_value = nullptr; |