From d59b72533ffbe4e11ef2bb12cfaffece3af58c74 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 17 Mar 2017 11:04:00 +0000 Subject: [PATCH] re PR other/80050 (gcc/genmatch.c: PVS-Studio: V590) 2017-03-17 Richard Biener PR middle-end/80050 * genmatch.c (parser::next): Remove pointless check for CPP_EOF. (parser::peek): Likewise. From-SVN: r246218 --- gcc/ChangeLog | 6 ++++++ gcc/genmatch.c | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 925709bdab7..9a160fae77e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-03-17 Richard Biener + + PR middle-end/80050 + * genmatch.c (parser::next): Remove pointless check for CPP_EOF. + (parser::peek): Likewise. + 2017-03-17 Richard Biener PR tree-optimization/80048 diff --git a/gcc/genmatch.c b/gcc/genmatch.c index fdf5aafb452..93d5b21d0be 100644 --- a/gcc/genmatch.c +++ b/gcc/genmatch.c @@ -3826,8 +3826,7 @@ parser::next () { token = cpp_get_token (r); } - while (token->type == CPP_PADDING - && token->type != CPP_EOF); + while (token->type == CPP_PADDING); return token; } @@ -3842,8 +3841,7 @@ parser::peek (unsigned num) { token = cpp_peek_token (r, i++); } - while ((token->type == CPP_PADDING - && token->type != CPP_EOF) + while (token->type == CPP_PADDING || (--num > 0)); /* If we peek at EOF this is a fatal error as it leaves the cpp_reader in unusable state. Assume we really wanted a -- 2.30.2