Skip to content

Commit 208298e

Browse files
committed
Fix findTransitiveUsesForAddress when foundUses vector is nullptr
The api should not behave differently when foundUses is nullptr. The only difference should be in populating it. No tests. Found by code inspection.
1 parent e5d2475 commit 208298e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lib/SIL/Utils/OwnershipUtils.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,14 +1065,12 @@ swift::findTransitiveUsesForAddress(SILValue projectedAddress,
10651065

10661066
// If we have a load_borrow, add it's end scope to the liveness requirement.
10671067
if (auto *lbi = dyn_cast<LoadBorrowInst>(user)) {
1068-
if (foundUses) {
1069-
// FIXME: if we can assume complete lifetimes, then this should be
1070-
// as simple as:
1071-
// for (Operand *use : lbi->getUses()) {
1072-
// if (use->endsLocalBorrowScope()) {
1073-
if (!findInnerTransitiveGuaranteedUses(lbi, foundUses)) {
1074-
result = meet(result, AddressUseKind::PointerEscape);
1075-
}
1068+
// FIXME: if we can assume complete lifetimes, then this should be
1069+
// as simple as:
1070+
// for (Operand *use : lbi->getUses()) {
1071+
// if (use->endsLocalBorrowScope()) {
1072+
if (!findInnerTransitiveGuaranteedUses(lbi, foundUses)) {
1073+
result = meet(result, AddressUseKind::PointerEscape);
10761074
}
10771075
continue;
10781076
}

0 commit comments

Comments
 (0)