yacc: fix push parser
commitcf899f7a7cc19661861344d2b34cc98f10273cd9
authorAkim Demaille <akim.demaille@gmail.com>
Sun, 7 Mar 2021 09:01:53 +0000 (7 10:01 +0100)
committerAkim Demaille <akim.demaille@gmail.com>
Sun, 7 Mar 2021 17:41:38 +0000 (7 18:41 +0100)
treee926c25751837d4587686095efbc049dd08dd1fb
parenta774839ca873d1082f79ba3c4eecc1e242a28ce1
yacc: fix push parser

When a pstate is used for multiple successive parses, some state may
leak from one run into the following one.  That was introduced in
330552ea499ca474f65967160e9d4e50265f9631 "yacc.c: push: don't clear
the parser state when accepting/rejecting".

Reported by Ryan <dev@splintermail.com>
https://lists.gnu.org/r/bug-bison/2021-03/msg00000.html

* data/skeletons/yacc.c (yypush_parse): We reusing a pstate from a
previous run, do behave as if it were the first run.
* tests/push.at (Pstate reuse): Check this.
NEWS
data/skeletons/yacc.c
tests/push.at