ABI checker: check validity of extended nominals before continue

rdar://87150470
This commit is contained in:
Xi Ge
2022-01-10 12:26:55 -08:00
parent 3d039251b4
commit 0dbcf79f29

View File

@@ -1906,10 +1906,11 @@ void SwiftDeclCollector::lookupVisibleDecls(ArrayRef<ModuleDecl *> Modules) {
for (auto *D: KnownDecls) {
if (auto *Ext = dyn_cast<ExtensionDecl>(D)) {
if (HandledExtensions.find(Ext) == HandledExtensions.end()) {
auto *NTD = Ext->getExtendedNominal();
// Check if the extension is from other modules.
if (!llvm::is_contained(Modules, NTD->getModuleContext())) {
ExtensionMap[NTD].push_back(Ext);
if (auto *NTD = Ext->getExtendedNominal()) {
// Check if the extension is from other modules.
if (!llvm::is_contained(Modules, NTD->getModuleContext())) {
ExtensionMap[NTD].push_back(Ext);
}
}
}
}