Skip to content

Commit 77caa2d

Browse files
committed
[Conformance cache] Handle missing protocol descriptors
This can happen when running against an older version of a library that doesn't have the protocol defined.
1 parent e32174a commit 77caa2d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

stdlib/public/runtime/ProtocolConformance.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,10 @@ namespace {
586586
if (auto proto = ProtoOrStorage.dyn_cast<const ProtocolDescriptor *>())
587587
return proto;
588588

589-
return ProtoOrStorage.get<const ExtendedStorage *>()->Proto;
589+
if (auto storage = ProtoOrStorage.dyn_cast<const ExtendedStorage *>())
590+
return storage->Proto;
591+
592+
return nullptr;
590593
}
591594

592595
/// Get the conformance cache key.

0 commit comments

Comments
 (0)