diff options
author | Kerem Kat <keremkat@gmail.com> | 2020-01-16 23:42:11 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2020-01-16 23:42:11 +0000 |
commit | 852f0ae80555238c425e33f98df5c7077694bd9f (patch) | |
tree | af3277d077383ad1305ca29e09c7bf5621392927 /gcc/testsuite/c-c++-common/pr92833-4.c | |
parent | f5b25e15165adde1356af42e9066ab75c5b37a19 (diff) | |
download | gcc-852f0ae80555238c425e33f98df5c7077694bd9f.zip gcc-852f0ae80555238c425e33f98df5c7077694bd9f.tar.gz gcc-852f0ae80555238c425e33f98df5c7077694bd9f.tar.bz2 |
Fix ICE caused by swallowing a token in c_parser_consume_token
This patch fixes ICE on invalid code, specifically files that have
conflict-marker-like signs before EOF.
PR c/92833
gcc/c/
* c-parser.c (c_parser_consume_token): Fix peeked token stack pop
to support 4 available tokens.
gcc/testsuite/
* c-c++-common/pr92833-1.c, c-c++-common/pr92833-2.c,
c-c++-common/pr92833-3.c, c-c++-common/pr92833-4.c: New tests.
Diffstat (limited to 'gcc/testsuite/c-c++-common/pr92833-4.c')
-rw-r--r-- | gcc/testsuite/c-c++-common/pr92833-4.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/pr92833-4.c b/gcc/testsuite/c-c++-common/pr92833-4.c new file mode 100644 index 0000000..b591ea9 --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr92833-4.c @@ -0,0 +1,7 @@ +/* Six marker characters at EOF, causes conflict marker detector to peek 4 + tokens. */ + +/* { dg-message "expected" "expected" { target *-*-* } .3 } */ +>> +>> +>>
\ No newline at end of file |