Skip to content

Commit 518a7bf

Browse files
committed
workaround for 'lastBlockILEndOffset < beginOffs'
1 parent c124174 commit 518a7bf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/coreclr/jit/async.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,6 +1709,15 @@ 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+
// to increasing after splitting off its tail.
1714+
// This tweak is just to avoid asserts later on.
1715+
// This is not a real fix.
1716+
if (block->bbCodeOffsEnd > (*remainder)->bbCodeOffs)
1717+
{
1718+
block->bbCodeOffsEnd = (*remainder)->bbCodeOffs;
1719+
}
1720+
17121721
FlowEdge* retBBEdge = m_comp->fgAddRefPred(suspendBB, block);
17131722
block->SetCond(retBBEdge, block->GetTargetEdge());
17141723

0 commit comments

Comments
 (0)