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;
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits