Skip to content

Commit abcc2dd

Browse files
committed
[OSSA] Fix ApplyInstBase::getCalleeOrigin for begin_borrow.
Handle begin_borrow -> convert_escape_to_noescape sequences.
1 parent b16dfcd commit abcc2dd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/swift/SIL/SILInstruction.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9048,6 +9048,11 @@ SILValue ApplyInstBase<Impl, Base, false>::getCalleeOrigin() const {
90489048
Callee = CETN->getOperand();
90499049
continue;
90509050
}
9051+
// convert_escape_to_noescape's are within a borrow scope.
9052+
if (auto *beginBorrow = dyn_cast<BeginBorrowInst>(Callee)) {
9053+
Callee = beginBorrow->getOperand();
9054+
continue;
9055+
}
90519056
return Callee;
90529057
}
90539058
}

0 commit comments

Comments
 (0)