fix not casting result of llvm.coro.promise

This commit is contained in:
Andrew Kelley 2018-03-01 10:23:47 -05:00
parent 253d988e7c
commit a7c87ae1e4

View File

@ -4026,7 +4026,8 @@ static LLVMValueRef ir_render_coro_promise(CodeGen *g, IrExecutable *executable,
LLVMConstInt(LLVMInt32Type(), get_coro_frame_align_bytes(g), false), LLVMConstInt(LLVMInt32Type(), get_coro_frame_align_bytes(g), false),
LLVMConstNull(LLVMInt1Type()), 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) { static LLVMValueRef get_coro_alloc_helper_fn_val(CodeGen *g, LLVMTypeRef alloc_fn_type_ref, TypeTableEntry *fn_type) {