]> granicus.if.org Git - clang/commitdiff
Fix getLocForEndOfToken to not double-count spurious internal characters
authorJohn McCall <rjmccall@apple.com>
Wed, 6 Apr 2011 01:50:22 +0000 (01:50 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 6 Apr 2011 01:50:22 +0000 (01:50 +0000)
within a token, like trigraphs and escaped newlines.
Patch by Marcin Kowalczyk!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128978 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/Lexer.cpp

index 6f3d611fb075c13556e499efce6b1babbe639b82..34b16c747773aad1f20935c7b4edaf67e62768e7 100644 (file)
@@ -674,7 +674,7 @@ SourceLocation Lexer::getLocForEndOfToken(SourceLocation Loc, unsigned Offset,
   else
     return Loc;
   
-  return AdvanceToTokenCharacter(Loc, Len, SM, Features);
+  return Loc.getFileLocWithOffset(Len);
 }
 
 //===----------------------------------------------------------------------===//