diff options
-rw-r--r-- | tools/libclang/CIndex.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 1ca60e245c..4570c6a1bd 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -2489,10 +2489,9 @@ AnnotateTokensWorker::Visit(CXCursor cursor, CXCursor parent) { if (TypeSourceInfo *TI = DD->getTypeSourceInfo()) { TypeLoc TL = TI->getTypeLoc(); SourceLocation TLoc = TL.getFullSourceRange().getBegin(); - if (TLoc.isValid()) { - assert(SrcMgr.isBeforeInTranslationUnit(TLoc, L)); + if (TLoc.isValid() && + SrcMgr.isBeforeInTranslationUnit(TLoc, L)) cursorRange.setBegin(TLoc); - } } } } |