]> granicus.if.org Git - clang/commitdiff
In MeasureTokenLength, the FileLoc supplied to the lexer must point to the start...
authorSebastian Redl <sebastian.redl@getdesigned.at>
Thu, 30 Sep 2010 01:03:03 +0000 (01:03 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Thu, 30 Sep 2010 01:03:03 +0000 (01:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115117 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/Lexer.cpp

index 917829be47c6a86321c9f7bb88fbade70fee0e71..519dd82285c97edbd6518a0c7cf813ec405f322d 100644 (file)
@@ -242,7 +242,8 @@ unsigned Lexer::MeasureTokenLength(SourceLocation Loc,
     return 0;
 
   // Create a lexer starting at the beginning of this token.
-  Lexer TheLexer(Loc, LangOpts, Buffer.begin(), StrData, Buffer.end());
+  Lexer TheLexer(SM.getLocForStartOfFile(LocInfo.first), LangOpts,
+                 Buffer.begin(), StrData, Buffer.end());
   TheLexer.SetCommentRetentionState(true);
   Token TheTok;
   TheLexer.LexFromRawLexer(TheTok);