fix and test case for returning from suspend block

See #3063
This commit is contained in:
Andrew Kelley
2019-08-16 13:00:48 -04:00
parent 2cb1f93894
commit 5a2cbe239f
3 changed files with 18 additions and 2 deletions

View File

@@ -5470,7 +5470,9 @@ static LLVMValueRef ir_render_assert_non_null(CodeGen *g, IrExecutable *executab
static LLVMValueRef ir_render_suspend_begin(CodeGen *g, IrExecutable *executable,
IrInstructionSuspendBegin *instruction)
{
instruction->resume_bb = gen_suspend_begin(g, "SuspendResume");
if (fn_is_async(g->cur_fn)) {
instruction->resume_bb = gen_suspend_begin(g, "SuspendResume");
}
return nullptr;
}