[cfe-commits] r38614 - /cfe/cfe/trunk/Lex/Lexer.cpp
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:23:13 PDT 2007
Author: sabre
Date: Wed Jul 11 11:23:13 2007
New Revision: 38614
URL: http://llvm.org/viewvc/llvm-project?rev=38614&view=rev
Log:
Fix Preprocessor/_Pragma-physloc.c, by making sure that the returned location
of the token is relative to the start of the buffer, not relative to the start
position of the lexer.
Modified:
cfe/cfe/trunk/Lex/Lexer.cpp
Modified: cfe/cfe/trunk/Lex/Lexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/Lexer.cpp?rev=38614&r1=38613&r2=38614&view=diff
==============================================================================
--- cfe/cfe/trunk/Lex/Lexer.cpp (original)
+++ cfe/cfe/trunk/Lex/Lexer.cpp Wed Jul 11 11:23:13 2007
@@ -130,9 +130,9 @@
/// getSourceLocation - Return a source location identifier for the specified
/// offset in the current file.
SourceLocation Lexer::getSourceLocation(const char *Loc) const {
- assert(Loc >= BufferStart && Loc <= BufferEnd &&
+ assert(Loc >= InputFile->getBufferStart() && Loc <= BufferEnd &&
"Location out of range for this buffer!");
- return SourceLocation(CurFileID, Loc-BufferStart);
+ return SourceLocation(CurFileID, Loc-InputFile->getBufferStart());
}
More information about the cfe-commits
mailing list