diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-05-22 21:09:31 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-05-22 21:09:31 +0000 |
commit | 48ce3b553b094a4209439ec7b322b730f47988e2 (patch) | |
tree | f5966aa8fde015e92f30944576954669aa288049 /clang/lib/Lex/TokenLexer.cpp | |
parent | 770c8e792772ee3fa0a66f1407ad6565a5c370e4 (diff) | |
download | bcm5719-llvm-48ce3b553b094a4209439ec7b322b730f47988e2.tar.gz bcm5719-llvm-48ce3b553b094a4209439ec7b322b730f47988e2.zip |
The TokenLexer may encounter annotations if the parser enters them using Preprocessor::EnterTokenStream.
So check for annotation before using the Token's IdentifierInfo.
llvm-svn: 72278
Diffstat (limited to 'clang/lib/Lex/TokenLexer.cpp')
-rw-r--r-- | clang/lib/Lex/TokenLexer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Lex/TokenLexer.cpp b/clang/lib/Lex/TokenLexer.cpp index af56af6bd39..f1af42aea51 100644 --- a/clang/lib/Lex/TokenLexer.cpp +++ b/clang/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 |