Skip to content

Commit edcaecc

Browse files
committed
Fix BorrowedValue::visitInteriorPointerOperandHelper
to handle borrowed-from (as a ForwardingInstruction).
1 parent 5f8b93c commit edcaecc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/SIL/Utils/OwnershipUtils.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,11 +1110,12 @@ bool BorrowedValue::visitInteriorPointerOperandHelper(
11101110
continue;
11111111
}
11121112

1113-
// Look through object.
1113+
// Look through object. SingleValueInstruction is overly restrictive but
1114+
// rules out any interesting corner cases.
11141115
if (auto *svi = dyn_cast<SingleValueInstruction>(user)) {
1115-
if (Projection::isObjectProjection(svi)) {
1116-
for (SILValue result : user->getResults()) {
1117-
llvm::copy(result->getUses(), std::back_inserter(worklist));
1116+
if (ForwardingInstruction::isa(user)) {
1117+
for (auto *use : svi->getUses()) {
1118+
worklist.push_back(use);
11181119
}
11191120
continue;
11201121
}

0 commit comments

Comments
 (0)