mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Tweak exclusivity access marker verification.
Narrow the list of address producers that verification can "peek through" to avoid trigger an assertion in the previous commit with -enable-verify-exclusivity.
This commit is contained in:
@@ -241,6 +241,12 @@ AccessedStorage swift::findAccessedStorage(SILValue sourceAddr) {
|
||||
if (kind != AccessedStorage::Unidentified)
|
||||
return AccessedStorage(address, kind);
|
||||
|
||||
// If the address producer cannot immediately be classified, follow the
|
||||
// use-def chain of address, box, or RawPointer producers.
|
||||
assert(address->getType().isAddress()
|
||||
|| isa<SILBoxType>(address->getType().getASTType())
|
||||
|| isa<BuiltinRawPointerType>(address->getType().getASTType()));
|
||||
|
||||
// Handle other unidentified address sources.
|
||||
switch (address->getKind()) {
|
||||
default:
|
||||
@@ -294,6 +300,12 @@ AccessedStorage swift::findAccessedStorage(SILValue sourceAddr) {
|
||||
return AccessedStorage();
|
||||
}
|
||||
|
||||
// ref_tail_addr project an address from a reference.
|
||||
// This is a valid address producer for nested @inout argument
|
||||
// access, but it is never used for formal access of identified objects.
|
||||
case ValueKind::RefTailAddrInst:
|
||||
return AccessedStorage(address, AccessedStorage::Unidentified);
|
||||
|
||||
// Inductive cases:
|
||||
// Look through address casts to find the source address.
|
||||
case ValueKind::MarkUninitializedInst:
|
||||
@@ -338,11 +350,10 @@ AccessedStorage swift::findAccessedStorage(SILValue sourceAddr) {
|
||||
address = cast<SingleValueInstruction>(address)->getOperand(0);
|
||||
continue;
|
||||
|
||||
// Subobject projections.
|
||||
// Address-to-address subobject projections.
|
||||
case ValueKind::StructElementAddrInst:
|
||||
case ValueKind::TupleElementAddrInst:
|
||||
case ValueKind::UncheckedTakeEnumDataAddrInst:
|
||||
case ValueKind::RefTailAddrInst:
|
||||
case ValueKind::TailAddrInst:
|
||||
case ValueKind::IndexAddrInst:
|
||||
address = cast<SingleValueInstruction>(address)->getOperand(0);
|
||||
|
||||
Reference in New Issue
Block a user