aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/libclang/CIndex.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index f4cae89f8f..d825a400f9 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -868,7 +868,8 @@ bool CursorVisitor::VisitObjCContainerDecl(ObjCContainerDecl *D) {
for (DeclContext::decl_iterator I = D->decls_begin(), E = D->decls_end();
I!=E; ++I) {
Decl *subDecl = *I;
- if (!subDecl || subDecl->getLexicalDeclContext() != D)
+ if (!subDecl || subDecl->getLexicalDeclContext() != D ||
+ subDecl->getLocStart().isInvalid())
continue;
DeclsInContainer.push_back(subDecl);
}