Skip to content

Commit d9a2ff4

Browse files
committed
Update lifetime completion utility to consider return_borrow
When return_borrow has both lifetime ending and non-lifetime ending use, consider it lifetime ending.
1 parent 4369c9c commit d9a2ff4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SIL/Utils/PrunedLiveness.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ void PrunedLiveRange<LivenessWithDefs>::updateForUse(
249249
// argument must be copied.
250250
auto iterAndSuccess = users.insert({user, lifetimeEnding});
251251
if (!iterAndSuccess.second) {
252-
if (isa<BranchInst>(user)) {
252+
if (isa<BranchInst>(user) || isa<ReturnBorrowInst>(user)) {
253253
branchMeetInPlace(iterAndSuccess.first->second, lifetimeEnding);
254254
} else {
255255
iterAndSuccess.first->second.meetInPlace(lifetimeEnding);

0 commit comments

Comments
 (0)