Skip to content

Commit 0dbcf79

Browse files
committed
ABI checker: check validity of extended nominals before continue
rdar://87150470
1 parent 3d03925 commit 0dbcf79

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/APIDigester/ModuleAnalyzerNodes.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,10 +1906,11 @@ void SwiftDeclCollector::lookupVisibleDecls(ArrayRef<ModuleDecl *> Modules) {
19061906
for (auto *D: KnownDecls) {
19071907
if (auto *Ext = dyn_cast<ExtensionDecl>(D)) {
19081908
if (HandledExtensions.find(Ext) == HandledExtensions.end()) {
1909-
auto *NTD = Ext->getExtendedNominal();
1910-
// Check if the extension is from other modules.
1911-
if (!llvm::is_contained(Modules, NTD->getModuleContext())) {
1912-
ExtensionMap[NTD].push_back(Ext);
1909+
if (auto *NTD = Ext->getExtendedNominal()) {
1910+
// Check if the extension is from other modules.
1911+
if (!llvm::is_contained(Modules, NTD->getModuleContext())) {
1912+
ExtensionMap[NTD].push_back(Ext);
1913+
}
19131914
}
19141915
}
19151916
}

0 commit comments

Comments
 (0)