Skip to content

Commit 47b71cc

Browse files
amanasifkhalidSimaTian
authored andcommitted
JIT: Unprotect handler entry after finally removal (#115907)
1 parent 5c87d9c commit 47b71cc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/coreclr/jit/fgehopt.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -751,8 +751,10 @@ PhaseStatus Compiler::fgRemoveEmptyTry()
751751
assert(firstHandlerBlock->bbRefs >= 2);
752752
firstHandlerBlock->bbRefs -= 1;
753753

754-
// (8) The old try entry no longer needs special protection.
754+
// (8) The old try/handler entries no longer need special protection.
755755
firstTryBlock->RemoveFlags(BBF_DONT_REMOVE);
756+
assert(!bbIsHandlerBeg(firstHandlerBlock));
757+
firstHandlerBlock->RemoveFlags(BBF_DONT_REMOVE);
756758

757759
// Another one bites the dust...
758760
emptyCount++;
@@ -1476,9 +1478,6 @@ PhaseStatus Compiler::fgCloneFinally()
14761478
{
14771479
// Mark the block as the start of the cloned finally.
14781480
newBlock->SetFlags(BBF_CLONED_FINALLY_BEGIN);
1479-
1480-
// Cloned finally entry block does not need any special protection.
1481-
newBlock->RemoveFlags(BBF_DONT_REMOVE);
14821481
}
14831482

14841483
if (block == lastBlock)
@@ -1487,6 +1486,7 @@ PhaseStatus Compiler::fgCloneFinally()
14871486
newBlock->SetFlags(BBF_CLONED_FINALLY_END);
14881487
}
14891488

1489+
// Cloned finally block does not need any special protection.
14901490
newBlock->RemoveFlags(BBF_DONT_REMOVE);
14911491

14921492
// Make sure clone block state hasn't munged the try region.

0 commit comments

Comments
 (0)