Skip to content

Commit 154e24e

Browse files
authored
Merge pull request #23574 from nkcsgexi/null-fix-std-priviate-5.1
[5.1] AST: fix a null pointer error found by performing module API checking
2 parents da7e486 + f624702 commit 154e24e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/AST/Decl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,10 @@ bool Decl::isPrivateStdlibDecl(bool treatNonBuiltinProtocolsAsPublic) const {
520520
}
521521

522522
if (auto ImportD = dyn_cast<ImportDecl>(D)) {
523-
if (ImportD->getModule()->isSwiftShimsModule())
524-
return true;
523+
if (auto *Mod = ImportD->getModule()) {
524+
if (Mod->isSwiftShimsModule())
525+
return true;
526+
}
525527
}
526528

527529
auto VD = dyn_cast<ValueDecl>(D);

0 commit comments

Comments
 (0)