mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +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
|
||||
permanent errs structure for this state, to record them. */
|
||||
state_errs_set (s, nerrs, errors);
|
||||
if (nerrs)
|
||||
{
|
||||
/* 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))
|
||||
{
|
||||
@@ -277,10 +280,7 @@ set_conflicts (state *s, symbol **errors)
|
||||
for (i = 0; i < reds->num; ++i)
|
||||
if (reds->rules[i]->prec && reds->rules[i]->prec->prec
|
||||
&& !bitset_disjoint_p (reds->lookaheads[i], lookaheadset))
|
||||
{
|
||||
resolve_sr_conflict (s, i, errors);
|
||||
break;
|
||||
}
|
||||
resolve_sr_conflict (s, i, errors);
|
||||
|
||||
/* Loop over all rules which require lookahead in this state. Check
|
||||
for conflicts not resolved above. */
|
||||
|
||||
Reference in New Issue
Block a user