aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-03-01 10:23:47 -0500
committerAndrew Kelley <superjoe30@gmail.com>2018-03-01 10:23:47 -0500
commita7c87ae1e4b621291a844df678cbe0fbfb531029 (patch)
treed2b5c20b62ff3bac97178c1fac4a97a46e1945f6 /src/codegen.cpp
parent253d988e7c00f7ad0cc1b5f913562cb5c1712c91 (diff)
downloadzig-a7c87ae1e4b621291a844df678cbe0fbfb531029.tar.gz
zig-a7c87ae1e4b621291a844df678cbe0fbfb531029.zip
fix not casting result of llvm.coro.promise
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 6534515edc..0cfd27322f 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -4026,7 +4026,8 @@ static LLVMValueRef ir_render_coro_promise(CodeGen *g, IrExecutable *executable,
LLVMConstInt(LLVMInt32Type(), get_coro_frame_align_bytes(g), false),
LLVMConstNull(LLVMInt1Type()),
};
- return LLVMBuildCall(g->builder, get_coro_promise_fn_val(g), params, 3, "");
+ LLVMValueRef uncasted_result = LLVMBuildCall(g->builder, get_coro_promise_fn_val(g), params, 3, "");
+ return LLVMBuildBitCast(g->builder, uncasted_result, instruction->base.value.type->type_ref, "");
}
static LLVMValueRef get_coro_alloc_helper_fn_val(CodeGen *g, LLVMTypeRef alloc_fn_type_ref, TypeTableEntry *fn_type) {