Skip to content

Commit

Permalink
JIT: Don't let 4-opt layout modify other EH regions (#111637)
Browse files Browse the repository at this point in the history
When trying to create fallthrough for a jump that begins after an EH region, and ends before the EH region, don't consider a split point within the EH region; otherwise, the swap will break the invariant that EH entries are not moved relative to other blocks in the region. Fixes #111347.
  • Loading branch information
amanasifkhalid authored Jan 21, 2025
1 parent 21e92cb commit 55a4602
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/coreclr/jit/fgopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5469,8 +5469,8 @@ bool Compiler::ThreeOptLayout::RunGreedyThreeOptPass(unsigned startPos, unsigned
continue;
}

// Don't consider any cut points that would move try/handler entries
if (compiler->bbIsTryBeg(s3BlockPrev) || compiler->bbIsHandlerBeg(s3BlockPrev))
// Don't consider any cut points that would disturb other EH regions
if (!BasicBlock::sameEHRegion(s2Block, s3Block))
{
continue;
}
Expand Down

0 comments on commit 55a4602

Please sign in to comment.