From: Akim Demaille Date: Sun, 7 Apr 2002 17:41:08 +0000 (+0000) Subject: As a result of the previous patch, it is no longer needed X-Git-Tag: BISON-1_49a~71 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/cc9305dd68c95c9d9c279ca2b2d6330078bf664c?ds=sidebyside As a result of the previous patch, it is no longer needed to reorder ritem itself. * src/reduce.c (reduce_grammar_tables): Don't sort RITEM. --- diff --git a/ChangeLog b/ChangeLog index 02980f52..09c3479e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-04-07 Akim Demaille + + As a result of the previous patch, it is no longer needed + to reorder ritem itself. + + * src/reduce.c (reduce_grammar_tables): Don't sort RITEM. + 2002-04-07 Akim Demaille Be sure never to walk through RITEMS, but use only data related to diff --git a/src/reduce.c b/src/reduce.c index db033b34..7cdc76ab 100644 --- a/src/reduce.c +++ b/src/reduce.c @@ -248,22 +248,14 @@ reduce_grammar_tables (void) free (rules + 1); rules = rules_sorted; - /* Also reorder ritems. */ - { - short *ritems_sorted = XCALLOC (short, nitems + 1); - short *ritemsp = ritems_sorted; - for (i = 1; i < nrules + 1; ++i) - { - short *rhsp = rules[i].rhs; - rules[i].rhs = ritemsp; - for (/* Nothing. */; *rhsp >= 0; ++rhsp) - *ritemsp++ = *rhsp; - *ritemsp++ = -i; - } - *ritemsp++ = 0; - free (ritem); - ritem = ritems_sorted; - } + /* Renumber the rules markers in RITEMS. */ + for (i = 1; i < nrules + 1; ++i) + { + short *rhsp = rules[i].rhs; + for (/* Nothing. */; *rhsp >= 0; ++rhsp) + /* Nothing. */; + *rhsp = -i; + } nrules -= nuseless_productions; }