forked from OSchip/llvm-project
In MeasureTokenLength, the FileLoc supplied to the lexer must point to the start of the buffer, or we risk overflow.
llvm-svn: 115117
This commit is contained in:
parent
2b76c66fd6
commit
517523014d
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue