X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/69363a9e4d0b8d3b51536434d3395d38519f617b..0ced3098fd97e1483b4ac938bdce99bfc7942539:/src/conflicts.c diff --git a/src/conflicts.c b/src/conflicts.c index 21ea7ce5..44546e1c 100644 --- a/src/conflicts.c +++ b/src/conflicts.c @@ -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. */ @@ -365,7 +365,7 @@ count_sr_conflicts (state *s) +`----------------------------------------------------------------*/ static int -count_rr_conflicts (state *s, int one_per_token) +count_rr_conflicts (state *s, bool one_per_token) { int i; reductions *reds = s->reductions; @@ -463,7 +463,7 @@ conflicts_print (void) /* Is the number of SR conflicts OK? Either EXPECTED_CONFLICTS is not set, and then we want 0 SR, or else it is specified, in which case we want equality. */ - int src_ok = 0; + bool src_ok = false; int src_total = 0; int rrc_total = 0;