Skip to content

Commit 4924b65

Browse files
committed
In GuaranteedOwnershipExtension::Status::ExtendLifetime mode, also extend the borrow scope if needed
1 parent aa54818 commit 4924b65

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/SILOptimizer/Utils/OwnershipOptUtils.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ void GuaranteedOwnershipExtension::transform(Status status) {
246246
PrunedLivenessBoundary ownedBoundary;
247247
ownedBoundary.compute(ownedLifetime, ownedConsumeBlocks);
248248
extendOwnedLifetime(beginBorrow->getOperand(), ownedBoundary, deleter);
249+
PrunedLivenessBoundary guaranteedBoundary;
250+
guaranteedBoundary.compute(guaranteedLiveness, ownedConsumeBlocks);
251+
extendLocalBorrow(beginBorrow, guaranteedBoundary, deleter);
249252
break;
250253
}
251254
}

0 commit comments

Comments
 (0)