Skip to content

JIT: Unprotect handler entry after finally removal #115907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/coreclr/jit/fgehopt.cpp
Original file line number Diff line number Diff line change
@@ -751,8 +751,10 @@ PhaseStatus Compiler::fgRemoveEmptyTry()
assert(firstHandlerBlock->bbRefs >= 2);
firstHandlerBlock->bbRefs -= 1;

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

// Another one bites the dust...
emptyCount++;
@@ -1476,9 +1478,6 @@ PhaseStatus Compiler::fgCloneFinally()
{
// Mark the block as the start of the cloned finally.
newBlock->SetFlags(BBF_CLONED_FINALLY_BEGIN);

// Cloned finally entry block does not need any special protection.
newBlock->RemoveFlags(BBF_DONT_REMOVE);
}

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

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

// Make sure clone block state hasn't munged the try region.
Loading
Oops, something went wrong.