aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index db135092e0..92ef48f50f 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -17682,6 +17682,11 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c
if (!handle_is_ptr(result_loc->value->type->data.pointer.child_type)) {
ir_reset_result(call_instruction->result_loc);
result_loc = nullptr;
+ } else {
+ call_instruction->base.value.type = return_type;
+ IrInstruction *casted_value = ir_implicit_cast(ira, &call_instruction->base, result_loc->value.type->data.pointer.child_type);
+ if (type_is_invalid(casted_value->value.type))
+ return casted_value;
}
}
} else if (call_instruction->is_async_call_builtin) {