Skip to content

Commit 0871c96

Browse files
committed
Fix BorrowedFromInst operand ownership.
This instruction obviously borrows its base value. Liveness extends to the uses of the result. Code that switches on OperandOwnership assumes that an Instantaneous use does not propagate any information that may extend liveness.
1 parent 6c99017 commit 0871c96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SIL/IR/OperandOwnership.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ OperandOwnershipClassifier::visitBeginBorrowInst(BeginBorrowInst *borrow) {
429429
OperandOwnership
430430
OperandOwnershipClassifier::visitBorrowedFromInst(BorrowedFromInst *bfi) {
431431
return getOperandIndex() == 0 ? OperandOwnership::GuaranteedForwarding
432-
: OperandOwnership::InstantaneousUse;
432+
: OperandOwnership::Borrow;
433433
}
434434

435435
// MARK: Instructions whose use ownership depends on the operand in question.

0 commit comments

Comments
 (0)