Skip to content

Commit

Permalink
JIT: Check DFS tree containment before checking ancestry
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobbotsch committed Jan 6, 2025
1 parent 1fb6148 commit c71cd27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/coreclr/jit/optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5730,7 +5730,7 @@ void Compiler::optRemoveRedundantZeroInits()
predEdge = predEdge->getNextPredEdge())
{
BasicBlock* const predBlock = predEdge->getSourceBlock();
if (m_dfsTree->IsAncestor(block, predBlock))
if (m_dfsTree->Contains(predBlock) && m_dfsTree->IsAncestor(block, predBlock))
{
JITDUMP(FMT_BB " is part of a cycle, stopping the block scan\n", block->bbNum);
stop = true;
Expand Down

0 comments on commit c71cd27

Please sign in to comment.