From: Ted Kremenek Date: Thu, 13 May 2010 15:38:38 +0000 (+0000) Subject: Fold assertion into condition, as it does not hold all the time. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6bfd53360072409715fe4e4d4f41d9ebdf948479;p=clang Fold assertion into condition, as it does not hold all the time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103716 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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); - } } } }