|
@@ -441,9 +441,10 @@ void HTMLDiagnostics::HandlePiece(Rewriter& R, FileID BugFileID,
|
|
FullSourceLoc L = MP->getLocation().asLocation().getExpansionLoc();
|
|
FullSourceLoc L = MP->getLocation().asLocation().getExpansionLoc();
|
|
assert(L.isFileID());
|
|
assert(L.isFileID());
|
|
StringRef BufferInfo = L.getBufferData();
|
|
StringRef BufferInfo = L.getBufferData();
|
|
- const char* MacroName = L.getDecomposedLoc().second + BufferInfo.data();
|
|
|
|
- Lexer rawLexer(L, PP.getLangOpts(), BufferInfo.begin(),
|
|
|
|
- MacroName, BufferInfo.end());
|
|
|
|
|
|
+ std::pair<FileID, unsigned> LocInfo = L.getDecomposedLoc();
|
|
|
|
+ const char* MacroName = LocInfo.second + BufferInfo.data();
|
|
|
|
+ Lexer rawLexer(SM.getLocForStartOfFile(LocInfo.first), PP.getLangOpts(),
|
|
|
|
+ BufferInfo.begin(), MacroName, BufferInfo.end());
|
|
|
|
|
|
Token TheTok;
|
|
Token TheTok;
|
|
rawLexer.LexFromRawLexer(TheTok);
|
|
rawLexer.LexFromRawLexer(TheTok);
|