Skip to content

Commit 52d8fdf

Browse files
authored
Merge pull request #40854 from nkcsgexi/87150470-5.6
[5.6] ABI checker: check validity of extended nominals before continue
2 parents 387aab2 + e10d189 commit 52d8fdf

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
@@ -1912,10 +1912,11 @@ void SwiftDeclCollector::lookupVisibleDecls(ArrayRef<ModuleDecl *> Modules) {
19121912
for (auto *D: KnownDecls) {
19131913
if (auto *Ext = dyn_cast<ExtensionDecl>(D)) {
19141914
if (HandledExtensions.find(Ext) == HandledExtensions.end()) {
1915-
auto *NTD = Ext->getExtendedNominal();
1916-
// Check if the extension is from other modules.
1917-
if (!llvm::is_contained(Modules, NTD->getModuleContext())) {
1918-
ExtensionMap[NTD].push_back(Ext);
1915+
if (auto *NTD = Ext->getExtendedNominal()) {
1916+
// Check if the extension is from other modules.
1917+
if (!llvm::is_contained(Modules, NTD->getModuleContext())) {
1918+
ExtensionMap[NTD].push_back(Ext);
1919+
}
19191920
}
19201921
}
19211922
}

0 commit comments

Comments
 (0)