[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.
This commit is contained in:
Doug Gregor
2025-04-15 21:11:19 -07:00
parent e32174abae
commit 77caa2dadd

View File

@@ -586,7 +586,10 @@ namespace {
if (auto proto = ProtoOrStorage.dyn_cast<const ProtocolDescriptor *>())
return proto;
return ProtoOrStorage.get<const ExtendedStorage *>()->Proto;
if (auto storage = ProtoOrStorage.dyn_cast<const ExtendedStorage *>())
return storage->Proto;
return nullptr;
}
/// Get the conformance cache key.