diff options
author | Jakub Jelinek <jakub@redhat.com> | 2015-04-06 19:01:50 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2015-04-06 19:01:50 +0200 |
commit | e4b33ee5e46bc68fa06d422c3900e8a1f6382e60 (patch) | |
tree | c79cf04375157868003884367ab0881cdd4beefb /libcpp/lex.c | |
parent | 6f0250431c61af7dcc7066437674d87300b386da (diff) |
re PR preprocessor/61977 (powerpc preprocessor breaks on lines that end with "vector")
PR preprocessor/61977
* lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
with all tokens peeked by the current function.
* gcc.dg/cpp/pr61977.c: New test.
From-SVN: r221882
Diffstat (limited to 'libcpp/lex.c')
-rw-r--r-- | libcpp/lex.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libcpp/lex.c b/libcpp/lex.c index d1e221110fc..ac96ff8dbe5 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -2090,11 +2090,14 @@ cpp_peek_token (cpp_reader *pfile, int index) { peektok = _cpp_lex_token (pfile); if (peektok->type == CPP_EOF) - return peektok; + { + index--; + break; + } } while (index--); - _cpp_backup_tokens_direct (pfile, count + 1); + _cpp_backup_tokens_direct (pfile, count - index); pfile->keep_tokens--; pfile->cb.line_change = line_change; |