]> granicus.if.org Git - clang/commitdiff
Fold assertion into condition, as it does not hold all the time.
authorTed Kremenek <kremenek@apple.com>
Thu, 13 May 2010 15:38:38 +0000 (15:38 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 13 May 2010 15:38:38 +0000 (15:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103716 91177308-0d34-0410-b5e6-96231b3b80d8

tools/libclang/CIndex.cpp

index 1ca60e245c7664b6d1cb332c7b602b6a1f080e9a..4570c6a1bd8abde2d7b9535180266d42693a20e9 100644 (file)
@@ -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);
-        }
       }
     }
   }