aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/TokenLexer.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-05-22 21:09:31 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-05-22 21:09:31 +0000
commit6f421f91849418883186592051fce05339ee62e9 (patch)
tree21918b88ae4989397bc178508f7ba03e4120be7d /lib/Lex/TokenLexer.cpp
parent34e65770ad6142b033d6cec4f476ed20fb248bf3 (diff)
The TokenLexer may encounter annotations if the parser enters them using Preprocessor::EnterTokenStream.
So check for annotation before using the Token's IdentifierInfo. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72278 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/TokenLexer.cpp')
-rw-r--r--lib/Lex/TokenLexer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Lex/TokenLexer.cpp b/lib/Lex/TokenLexer.cpp
index af56af6bd3..f1af42aea5 100644
--- a/lib/Lex/TokenLexer.cpp
+++ b/lib/Lex/TokenLexer.cpp
@@ -342,9 +342,10 @@ void TokenLexer::Lex(Token &Tok) {
}
// Handle recursive expansion!
- if (IdentifierInfo *II = Tok.getIdentifierInfo()) {
+ if (!Tok.isAnnotation() && Tok.getIdentifierInfo() != 0) {
// Change the kind of this identifier to the appropriate token kind, e.g.
// turning "for" into a keyword.
+ IdentifierInfo *II = Tok.getIdentifierInfo();
Tok.setKind(II->getTokenID());
// If this identifier was poisoned and from a paste, emit an error. This