detect async fn recursion and emit compile error

This commit is contained in:
Andrew Kelley
2019-10-27 17:31:06 -04:00
parent a3222b5ff1
commit 4f594527c0
2 changed files with 8 additions and 0 deletions

View File

@@ -3917,6 +3917,7 @@ static LLVMValueRef ir_render_call(CodeGen *g, IrExecutable *executable, IrInstr
if (instruction->modifier == CallModifierAsync) {
frame_result_loc = result_loc;
} else {
src_assert(instruction->frame_result_loc != nullptr, instruction->base.source_node);
frame_result_loc_uncasted = ir_llvm_value(g, instruction->frame_result_loc);
src_assert(instruction->fn_entry != nullptr, instruction->base.source_node);
frame_result_loc = LLVMBuildBitCast(g->builder, frame_result_loc_uncasted,