glr2.cc: fix yycompressStack

Currently, yycompressStack expects the free items to be states only.
That's not the case.

Fixes 712 and 730 pass.  748 still fails, but later and
differently (heap-use-after-free).

* data/skeletons/glr2.cc (glr_stack_item::setState): New.
(glr_stack_item::yycompressStack): Use it.
* tests/glr-regression.at: Adjust.
This commit is contained in:
Akim Demaille
2020-12-12 17:32:01 +01:00
parent 5b65b3d543
commit c8006f4637
2 changed files with 15 additions and 4 deletions

View File

@@ -142,7 +142,6 @@ m4_pushdef([AT_TEST],
[AT_SETUP([Improper handling of embedded actions and dollar(-N) in GLR parsers: $1])
AT_BISON_OPTION_PUSHDEFS([%glr-parser $1])
AT_GLR2_CC_IF([AT_XFAIL_IF([true])])
AT_DATA_GRAMMAR([glr-regr2a.y],
[[/* Regression Test: Improper handling of embedded actions and $-N */
@@ -744,7 +743,6 @@ m4_pushdef([AT_TEST],
[AT_SETUP([Incorrectly initialized location for empty right-hand side in GLR: $1])
AT_BISON_OPTION_PUSHDEFS([%glr-parser %locations $1])
AT_GLR2_CC_IF([AT_XFAIL_IF([true])])
AT_DATA_GRAMMAR([glr-regr8.y],
[[