summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-11-02 23:17:51 +0000
committerTed Kremenek <kremenek@apple.com>2010-11-02 23:17:51 +0000
commit4bd4d75b9aad1617a6f4e572d7756f5ca22dedbc (patch)
tree47cde3688d47a43914a54b2e783d38ba40d0326d /clang
parenta8b6315cd71dd112178a2cde6d62aa65e25682c2 (diff)
downloadbcm5719-llvm-4bd4d75b9aad1617a6f4e572d7756f5ca22dedbc.tar.gz
bcm5719-llvm-4bd4d75b9aad1617a6f4e572d7756f5ca22dedbc.zip
Don't add Decls with an invalid location to DeclsInContainer.
llvm-svn: 118111
Diffstat (limited to 'clang')
-rw-r--r--clang/tools/libclang/CIndex.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index f4cae89f8fc..d825a400f99 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/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);
}
OpenPOWER on IntegriCloud