[cfe-commits] r145301 - /cfe/trunk/tools/libclang/CIndex.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Mon Nov 28 14:38:07 PST 2011
Author: akirtzidis
Date: Mon Nov 28 16:38:07 2011
New Revision: 145301
URL: http://llvm.org/viewvc/llvm-project?rev=145301&view=rev
Log:
[libclang] Protect against the declaration's SourceRange being invalid
before passing to RangeCompare.
Though no idea how this can occur with the decls returned from
findFileRegionDecls().
Modified:
cfe/trunk/tools/libclang/CIndex.cpp
Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=145301&r1=145300&r2=145301&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Mon Nov 28 16:38:07 2011
@@ -286,6 +286,8 @@
SmallVector<Decl *, 16>::iterator DIt = Decls.begin();
for (SmallVector<Decl *, 16>::iterator DE = Decls.end(); DIt != DE; ++DIt) {
Decl *D = *DIt;
+ if (D->getSourceRange().isInvalid())
+ continue;
if (isInLexicalContext(D, CurDC))
continue;
More information about the cfe-commits
mailing list