Skip to content

Commit

Permalink
Correct control flow in getParentBreakBlockSet (shader-slang#5024)
Browse files Browse the repository at this point in the history
Co-authored-by: ArielG-NV <[email protected]>
Co-authored-by: Yong He <[email protected]>
  • Loading branch information
3 people authored Sep 6, 2024
1 parent dcd6c24 commit 69ee8f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/slang/slang-ir-util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1430,11 +1430,15 @@ HashSet<IRBlock*> getParentBreakBlockSet(IRDominatorTree* dom, IRBlock* block)
currBlock = dom->getImmediateDominator(currBlock))
{
if (auto loopInst = as<IRLoop>(currBlock->getTerminator()))
{
if (!dom->dominates(loopInst->getBreakBlock(), block))
parentBreakBlocksSet.add(loopInst->getBreakBlock());
}
else if (auto switchInst = as<IRSwitch>(currBlock->getTerminator()))
{
if (!dom->dominates(switchInst->getBreakLabel(), block))
parentBreakBlocksSet.add(switchInst->getBreakLabel());
}
}

return parentBreakBlocksSet;
Expand Down

0 comments on commit 69ee8f6

Please sign in to comment.