aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorVexu <15308111+Vexu@users.noreply.github.com>2019-11-19 22:54:32 +0200
committerAndrew Kelley <andrew@ziglang.org>2019-11-26 14:32:34 -0500
commit0e405c5fc52945a03711454e86c1caa7c72c4d02 (patch)
treee4ce7066139e5ffe9f932dc3b9cb8f72883bb93d /src/ir.cpp
parent7de138ad7cef1f9d1743a82f9a0419142484f24a (diff)
downloadzig-0e405c5fc52945a03711454e86c1caa7c72c4d02.tar.gz
zig-0e405c5fc52945a03711454e86c1caa7c72c4d02.zip
add missing cast to call result type
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) {