Skip to content

Commit ce10e5c

Browse files
committed
Address feedback
1 parent aa74f08 commit ce10e5c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/coreclr/jit/optimizebools.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ bool Compiler::fgFoldCondToReturnBlock(BasicBlock* block)
16921692
#endif
16931693

16941694
// Early out if the current method is not returning a boolean.
1695-
if ((info.compRetType != TYP_UBYTE) || (genReturnBB != nullptr))
1695+
if ((info.compRetType != TYP_UBYTE))
16961696
{
16971697
return modified;
16981698
}
@@ -1723,7 +1723,8 @@ bool Compiler::fgFoldCondToReturnBlock(BasicBlock* block)
17231723
retTrueBb = block->GetTrueTarget();
17241724
retFalseBb = block->GetFalseTarget();
17251725
if (!retTrueBb->KindIs(BBJ_RETURN) || !retFalseBb->KindIs(BBJ_RETURN) ||
1726-
!BasicBlock::sameEHRegion(block, retTrueBb) || !BasicBlock::sameEHRegion(block, retFalseBb))
1726+
!BasicBlock::sameEHRegion(block, retTrueBb) || !BasicBlock::sameEHRegion(block, retFalseBb) ||
1727+
(retTrueBb == genReturnBB) || (retFalseBb == genReturnBB))
17271728
{
17281729
// Both edges must be BBJ_RETURN
17291730
return modified;

0 commit comments

Comments
 (0)