Skip to content

Commit e15eab5

Browse files
committed
[ownership] Change ForwardingOperand::visitForwardingValues to handle ForwardingOwned terminators that are function exiting correctly.
Previously, we would have just asserted when we passed the operand to PhiOperand on the next line of the code.
1 parent a5d7a09 commit e15eab5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/SIL/Utils/OwnershipUtils.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,6 +1612,11 @@ bool ForwardingOperand::visitForwardedValues(
16121612
});
16131613
}
16141614

1615+
// If our terminator is function exiting, we do not have a value to visit, so
1616+
// just return.
1617+
if (ti->isFunctionExiting())
1618+
return true;
1619+
16151620
auto *succArg = PhiOperand(use).getValue();
16161621
return visitor(succArg);
16171622
}

0 commit comments

Comments
 (0)