]> granicus.if.org Git - clang/commitdiff
add an assertion
authorChris Lattner <sabre@nondot.org>
Wed, 28 May 2008 16:35:02 +0000 (16:35 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 28 May 2008 16:35:02 +0000 (16:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51645 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Rewrite/Rewriter.cpp

index bea7c00352d2fa466c556ba0bddf26d25135533b..e1a6651a9aead999fd77c0b6c4ab113105d4341f 100644 (file)
@@ -100,6 +100,7 @@ int Rewriter::getRangeSize(SourceRange Range) const {
 
 unsigned Rewriter::getLocationOffsetAndFileID(SourceLocation Loc,
                                               unsigned &FileID) const {
+  assert(Loc.isValid() && "Invalid location");
   std::pair<unsigned,unsigned> V = SourceMgr->getDecomposedFileLoc(Loc);
   FileID = V.first;
   return V.second;