diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-11-02 23:17:51 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-11-02 23:17:51 +0000 |
commit | 0582c897ec7261b4c6af0fe26dc2a0b6b54d266c (patch) | |
tree | 7a9cefeded62e446097543944a9addbc6e3c5bf7 | |
parent | d8c370ca95a3bccc36c4a6b92a4042809ff51ee4 (diff) |
Don't add Decls with an invalid location to DeclsInContainer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118111 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | tools/libclang/CIndex.cpp | 3 |
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); } |