Skip to content

Commit 1761fc2

Browse files
committed
Consider store_borrow as a write in LoadBorrowImmutabilityChecker
1 parent b7c23ed commit 1761fc2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/SIL/Verifier/LoadBorrowImmutabilityChecker.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ bool GatherWritesVisitor::visitUse(Operand *op, AccessUseType useTy) {
108108
case SILInstructionKind::DestroyValueInst:
109109
case SILInstructionKind::InjectEnumAddrInst:
110110
case SILInstructionKind::StoreInst:
111+
case SILInstructionKind::StoreBorrowInst:
111112
case SILInstructionKind::AssignInst:
112113
case SILInstructionKind::UncheckedTakeEnumDataAddrInst:
113114
case SILInstructionKind::MarkFunctionEscapeInst:
@@ -130,10 +131,6 @@ bool GatherWritesVisitor::visitUse(Operand *op, AccessUseType useTy) {
130131
#include "swift/AST/ReferenceStorage.def"
131132

132133
// Ignored pointer uses...
133-
134-
// Allow store_borrow within the load_borrow scope.
135-
// FIXME: explain why.
136-
case SILInstructionKind::StoreBorrowInst:
137134
// Returns are never in scope.
138135
case SILInstructionKind::ReturnInst:
139136
return true;

0 commit comments

Comments
 (0)