diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-07-12 04:25:32 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-07-12 04:25:32 +0000 |
| commit | 5a503e9f7068c528ac846d016c6c80aad640ae04 (patch) | |
| tree | dbd251c6db9d44b32a6516e167527d6faea74cc7 /clang/lib/Lex | |
| parent | 6635f9838e182dfe805288dc10e83fdfded7c6bb (diff) | |
| download | bcm5719-llvm-5a503e9f7068c528ac846d016c6c80aad640ae04.tar.gz bcm5719-llvm-5a503e9f7068c528ac846d016c6c80aad640ae04.zip | |
we do in fact have to cache the EOF token returned by the preprocessor.
In the case of backtracking, the cached token lexer will be the only
lexer on the stack, without this the token stack will be empty and EOF
won't be returned.
This fixes PR7072.
llvm-svn: 108124
Diffstat (limited to 'clang/lib/Lex')
| -rw-r--r-- | clang/lib/Lex/PPCaching.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/clang/lib/Lex/PPCaching.cpp b/clang/lib/Lex/PPCaching.cpp index 6aeb6fa3a2f..20e3b3dd9d8 100644 --- a/clang/lib/Lex/PPCaching.cpp +++ b/clang/lib/Lex/PPCaching.cpp @@ -60,13 +60,10 @@ void Preprocessor::CachingLex(Token &Result) { return; } - // We should cache the lexed token. - + // Cache the lexed token. EnterCachingLexMode(); - if (Result.isNot(tok::eof)) { - CachedTokens.push_back(Result); - ++CachedLexPos; - } + CachedTokens.push_back(Result); + ++CachedLexPos; } void Preprocessor::EnterCachingLexMode() { |

