mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-23 03:03:02 +00:00
(set_conflicts): Resolve all conflicts, not just
the first one. This change is from Paul Hilfinger, and it fixes regression reported by Werner Lemberg in <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>. (resolve_sr_conflict): Don't invoke state_errs_set unless one or more tokens have been explicitly made errors. Otherwise, the above change causes Bison to abort.
This commit is contained in:
@@ -237,9 +237,12 @@ resolve_sr_conflict (state *s, int ruleno, symbol **errors)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Some tokens have been explicitly made errors. Allocate a
|
if (nerrs)
|
||||||
permanent errs structure for this state, to record them. */
|
{
|
||||||
state_errs_set (s, nerrs, errors);
|
/* Some tokens have been explicitly made errors. Allocate a
|
||||||
|
permanent errs structure for this state, to record them. */
|
||||||
|
state_errs_set (s, nerrs, errors);
|
||||||
|
}
|
||||||
|
|
||||||
if (obstack_object_size (&solved_conflicts_obstack))
|
if (obstack_object_size (&solved_conflicts_obstack))
|
||||||
{
|
{
|
||||||
@@ -277,10 +280,7 @@ set_conflicts (state *s, symbol **errors)
|
|||||||
for (i = 0; i < reds->num; ++i)
|
for (i = 0; i < reds->num; ++i)
|
||||||
if (reds->rules[i]->prec && reds->rules[i]->prec->prec
|
if (reds->rules[i]->prec && reds->rules[i]->prec->prec
|
||||||
&& !bitset_disjoint_p (reds->lookaheads[i], lookaheadset))
|
&& !bitset_disjoint_p (reds->lookaheads[i], lookaheadset))
|
||||||
{
|
resolve_sr_conflict (s, i, errors);
|
||||||
resolve_sr_conflict (s, i, errors);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Loop over all rules which require lookahead in this state. Check
|
/* Loop over all rules which require lookahead in this state. Check
|
||||||
for conflicts not resolved above. */
|
for conflicts not resolved above. */
|
||||||
|
|||||||
Reference in New Issue
Block a user