Skip to content

Commit 3320823

Browse files
authored
Merge pull request swiftlang#23573 from nkcsgexi/null-ptr-isprivate
AST: fix a null pointer error found by performing module API checking
2 parents 446015d + bc9a7dd commit 3320823

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
@@ -530,8 +530,10 @@ bool Decl::isPrivateStdlibDecl(bool treatNonBuiltinProtocolsAsPublic) const {
530530
}
531531

532532
if (auto ImportD = dyn_cast<ImportDecl>(D)) {
533-
if (ImportD->getModule()->isSwiftShimsModule())
534-
return true;
533+
if (auto *Mod = ImportD->getModule()) {
534+
if (Mod->isSwiftShimsModule())
535+
return true;
536+
}
535537
}
536538

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

0 commit comments

Comments
 (0)