Skip to content

Commit bc9a7dd

Browse files
committed
AST: fix a null pointer error found by performing module API checking
1 parent fbd1d4c commit bc9a7dd

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)