[cfe-commits] r63057 - /cfe/trunk/lib/Lex/Lexer.cpp
Chris Lattner
sabre at nondot.org
Mon Jan 26 14:24:27 PST 2009
Author: lattner
Date: Mon Jan 26 16:24:27 2009
New Revision: 63057
URL: http://llvm.org/viewvc/llvm-project?rev=63057&view=rev
Log:
Fix a bug I introduced in my changes, which caused MeasureTokenLength
to crash when given an instantiation location. Thanks to Fariborz for
the testcase.
Modified:
cfe/trunk/lib/Lex/Lexer.cpp
Modified: cfe/trunk/lib/Lex/Lexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Lexer.cpp?rev=63057&r1=63056&r2=63057&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Lexer.cpp (original)
+++ cfe/trunk/lib/Lex/Lexer.cpp Mon Jan 26 16:24:27 2009
@@ -222,7 +222,8 @@
// If this comes from a macro expansion, we really do want the macro name, not
// the token this macro expanded to.
- std::pair<FileID, unsigned> LocInfo = SM.getDecomposedInstantiationLoc(Loc);
+ Loc = SM.getInstantiationLoc(Loc);
+ std::pair<FileID, unsigned> LocInfo = SM.getDecomposedLoc(Loc);
std::pair<const char *,const char *> Buffer = SM.getBufferData(LocInfo.first);
const char *StrData = Buffer.first+LocInfo.second;
More information about the cfe-commits
mailing list