cex: fix state-item pruning

There were several bugs in pruning that would leave the state-item
graph in an inconsistent state which could cause crashes later on:

- Pruning now happens in one pass instead of two.

- Disabled state-items no longer prune the state-items they transition
  to if that state-item has other states that transition to it.

- State-items that transition to disabled state-items are always
  pruned even if they have productions.

Reported by Michal Bartkowiak <michal.bartkowiak@nokia.com>
https://lists.gnu.org/r/bug-bison/2021-01/msg00000.html
and Zartaj Majeed
https://github.com/akimd/bison/issues/71

* src/state-item.c (prune_forward, prune_backward): Fuse into...
(prune_state_item): this.
Adjust callers.
This commit is contained in:
Vincent Imbimbo
2021-01-23 13:25:18 -05:00
committed by Akim Demaille
parent 236b85dd28
commit 2c294c1325
2 changed files with 26 additions and 37 deletions

4
NEWS
View File

@@ -4,6 +4,10 @@ GNU Bison NEWS
** Bug fixes
*** Counterexample Generation
In some cases counterexample generation could crash. This is fixed.
*** GLR parsers now support %merge together with api.value.type=union.
*** C++ parsers use noexcept in more places.