mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
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
330552ea49 "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.
This commit is contained in:
8
NEWS
8
NEWS
@@ -4,11 +4,17 @@ GNU Bison NEWS
|
||||
|
||||
** Bug fixes
|
||||
|
||||
*** Reused Push Parsers
|
||||
|
||||
When a push-parser state structure is used for multiple parses, it was
|
||||
possible for some state to leak from one run into the following one.
|
||||
|
||||
*** Fix Table Generation
|
||||
|
||||
In some very rare conditions, when there are many useless tokens, it was
|
||||
possible to generate incorrect parsers.
|
||||
|
||||
|
||||
* Noteworthy changes in release 3.7.5 (2021-01-24) [stable]
|
||||
|
||||
** Bug fixes
|
||||
@@ -290,7 +296,7 @@ GNU Bison NEWS
|
||||
parse errors, since `yynerrs` was also reset. This can be especially
|
||||
troublesome when used in autocompletion, since a parser with error
|
||||
recovery would suggest (irrelevant) expected tokens even if there were
|
||||
failure.
|
||||
failures.
|
||||
|
||||
Now the parser state can be examined when parsing is finished. The parser
|
||||
state is reset when starting a new parse.
|
||||
|
||||
Reference in New Issue
Block a user