Skip to content

Commit 5f8b93c

Browse files
committed
Fix interior liveness to report the escaping instruction as a use.
1 parent f29bb44 commit 5f8b93c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/SIL/Utils/OwnershipLiveness.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ struct InteriorLivenessVisitor :
150150

151151
bool handlePointerEscape(Operand *use) {
152152
interiorLiveness.addressUseKind = AddressUseKind::PointerEscape;
153+
if (!handleUsePoint(use, UseLifetimeConstraint::NonLifetimeEnding))
154+
return false;
153155

154156
return true;
155157
}

lib/SIL/Utils/OwnershipUtils.cpp

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

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

0 commit comments

Comments
 (0)