Skip to content

Commit 1314892

Browse files
committed
workaround for 'lastBlockILEndOffset < beginOffs'
1 parent ba280ba commit 1314892

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/coreclr/jit/async.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,6 +1709,14 @@ void AsyncTransformation::CreateCheckAndSuspendAfterCall(BasicBlock*
17091709
*remainder = m_comp->fgSplitBlockAfterNode(block, jtrue);
17101710
JITDUMP(" Remainder is " FMT_BB "\n", (*remainder)->bbNum);
17111711

1712+
// HACK: Not sure why it can happen, but we may see the end IL for the block.
1713+
// This is just to avoid asserts later on.
1714+
// This is not a real fix.
1715+
if (block->bbCodeOffsEnd > (*remainder)->bbCodeOffs)
1716+
{
1717+
block->bbCodeOffsEnd = (*remainder)->bbCodeOffs;
1718+
}
1719+
17121720
FlowEdge* retBBEdge = m_comp->fgAddRefPred(suspendBB, block);
17131721
block->SetCond(retBBEdge, block->GetTargetEdge());
17141722

0 commit comments

Comments
 (0)