From 6053ca4f69e490c744384bd02e89df595ff7b085 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 21 Jul 2019 17:10:16 -0400 Subject: fix not jumping to entry --- src/ir.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index 96d355bc95..2b3462772f 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -24121,9 +24121,11 @@ static IrInstruction *ir_analyze_instruction_suspend_br(IrAnalyze *ira, IrInstru ZigFn *fn_entry = exec_fn_entry(ira->new_irb.exec); ir_assert(fn_entry != nullptr, &instruction->base); + + // +2 - one for the GetSize block, one for the Entry block, resume blocks are indexed after that. + new_bb->resume_index = fn_entry->resume_blocks.length + 2; + fn_entry->resume_blocks.append(new_bb); - // This is done after appending the block because resume_index 0 is reserved for querying the size. - new_bb->resume_index = fn_entry->resume_blocks.length; ir_push_resume_block(ira, old_dest_block); -- cgit v1.2.3