forked from OSchip/llvm-project
Fix a bug I introduced in my changes, which caused MeasureTokenLength
to crash when given an instantiation location. Thanks to Fariborz for the testcase. llvm-svn: 63057
This commit is contained in:
parent
b6d36e1d14
commit
d381721810
|
@ -222,7 +222,8 @@ unsigned Lexer::MeasureTokenLength(SourceLocation Loc,
|
|||
|
||||
// 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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue