aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-05-13 15:38:38 +0000
committerTed Kremenek <kremenek@apple.com>2010-05-13 15:38:38 +0000
commit6bfd53360072409715fe4e4d4f41d9ebdf948479 (patch)
tree927b040d5c11dbbfc0869c2a2dfd84011918348e
parent6614b2d27df66cc72c7b088c19fcca54084e7ee5 (diff)
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
-rw-r--r--tools/libclang/CIndex.cpp5
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);
- }
}
}
}