Skip to content

Commit 55a4602

Browse files
JIT: Don't let 4-opt layout modify other EH regions (#111637)
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.
1 parent 21e92cb commit 55a4602

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/coreclr/jit/fgopt.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -5469,8 +5469,8 @@ bool Compiler::ThreeOptLayout::RunGreedyThreeOptPass(unsigned startPos, unsigned
54695469
continue;
54705470
}
54715471

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

0 commit comments

Comments
 (0)