codegen: Store returned value if type is 'handle_is_ptr' and function is not 'first_arg_ret'.
Seems to fix #1230, includes test.
This commit is contained in:
committed by
Andrew Kelley
parent
2a719ee6c5
commit
722b9b9e59
@@ -3166,6 +3166,10 @@ static LLVMValueRef ir_render_call(CodeGen *g, IrExecutable *executable, IrInstr
|
||||
return nullptr;
|
||||
} else if (first_arg_ret) {
|
||||
return instruction->tmp_ptr;
|
||||
} else if (handle_is_ptr(src_return_type)) {
|
||||
auto store_instr = LLVMBuildStore(g->builder, result, instruction->tmp_ptr);
|
||||
LLVMSetAlignment(store_instr, LLVMGetAlignment(instruction->tmp_ptr));
|
||||
return instruction->tmp_ptr;
|
||||
} else {
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user