]> granicus.if.org Git - clang/commitdiff
Fix subtle bug in Preprocessor::AdvanceToTokenCharacter(): use '+=' instead of '='.
authorTed Kremenek <kremenek@apple.com>
Fri, 29 Jan 2010 19:38:24 +0000 (19:38 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 29 Jan 2010 19:38:24 +0000 (19:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94830 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/Preprocessor.cpp

index 5689baaac652f95428dda05086b20af4bb80927c..df0e702ab447b7e6e9edbe4835e79196d0628c58 100644 (file)
@@ -424,7 +424,7 @@ SourceLocation Preprocessor::AdvanceToTokenCharacter(SourceLocation TokStart,
   // advanced by 3 should return the location of b, not of \\.  One compounding
   // detail of this is that the escape may be made by a trigraph.
   if (!Lexer::isObviouslySimpleCharacter(*TokPtr))
-    PhysOffset = Lexer::SkipEscapedNewLines(TokPtr)-TokPtr;
+    PhysOffset += Lexer::SkipEscapedNewLines(TokPtr)-TokPtr;
 
   return TokStart.getFileLocWithOffset(PhysOffset);
 }