aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Index/IndexDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Index/IndexDecl.cpp')
-rw-r--r--clang/lib/Index/IndexDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Index/IndexDecl.cpp b/clang/lib/Index/IndexDecl.cpp
index 2ba323e..00adb36 100644
--- a/clang/lib/Index/IndexDecl.cpp
+++ b/clang/lib/Index/IndexDecl.cpp
@@ -759,7 +759,7 @@ bool IndexingContext::indexDeclContext(const DeclContext *DC) {
}
bool IndexingContext::indexTopLevelDecl(const Decl *D) {
- if (D->getLocation().isInvalid())
+ if (!D || D->getLocation().isInvalid())
return true;
if (isa<ObjCMethodDecl>(D))