Skip to content

Commit 3df1e72

Browse files
authored
Merge pull request #40785 from nkcsgexi/87150470
ABI checker: check validity of extended nominals before continue
2 parents 24a6f37 + 0dbcf79 commit 3df1e72

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)