Skip to content

Commit

Permalink
JIT: Don't convert unreachable BBJ_CALLFINALLYRET blocks to BBJ_THROW…
Browse files Browse the repository at this point in the history
… during morph (#109519)
  • Loading branch information
amanasifkhalid authored Nov 5, 2024
1 parent 9ef212c commit 33af1a2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13379,12 +13379,11 @@ void Compiler::fgMorphBlock(BasicBlock* block, MorphUnreachableInfo* unreachable
unreachableInfo->SetUnreachable(block);

// Remove the block's IR and flow edges but don't mark the block as removed.
// Convert to BBJ_THROW. But leave CALLFINALLY alone.
// Convert to BBJ_THROW. But leave CALLFINALLY(RET) alone.
//
// If we clear out the block, there is nothing to morph, so just return.
//
bool const isCallFinally = block->KindIs(BBJ_CALLFINALLY);
if (!isCallFinally)
if (!block->KindIs(BBJ_CALLFINALLY, BBJ_CALLFINALLYRET))
{
fgUnreachableBlock(block);
block->RemoveFlags(BBF_REMOVED);
Expand Down

0 comments on commit 33af1a2

Please sign in to comment.