diff options
author | thegeorg <thegeorg@yandex-team.com> | 2024-08-11 11:42:23 +0300 |
---|---|---|
committer | thegeorg <thegeorg@yandex-team.com> | 2024-08-11 11:54:06 +0300 |
commit | cd788243496b69e548998f9e3f9ff80e34977652 (patch) | |
tree | 0fd50f566b69bc2cfd0d9c4c18eea1b77d5ec276 /contrib/tools/bison/src/derives.c | |
parent | c7230d56fb1b7998da0edb829f1751640da9c8b4 (diff) | |
download | ydb-cd788243496b69e548998f9e3f9ff80e34977652.tar.gz |
Update contrib/tools/bison to 3.7.6
583623e1fb299df0a04a0aecdc47eb759ef412b9
Diffstat (limited to 'contrib/tools/bison/src/derives.c')
-rw-r--r-- | contrib/tools/bison/src/derives.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/tools/bison/src/derives.c b/contrib/tools/bison/src/derives.c index c859a5e23d..4ea5f78bb4 100644 --- a/contrib/tools/bison/src/derives.c +++ b/contrib/tools/bison/src/derives.c @@ -1,6 +1,6 @@ /* Match rules with nonterminals for bison, - Copyright (C) 1984, 1989, 2000-2003, 2005, 2009-2015, 2018-2020 Free + Copyright (C) 1984, 1989, 2000-2003, 2005, 2009-2015, 2018-2021 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */ #include <config.h> #include "system.h" @@ -47,7 +47,7 @@ print_derives (void) fprintf (stderr, " %s derives\n", symbols[i]->tag); for (rule **rp = derives[i - ntokens]; *rp; ++rp) { - fprintf (stderr, " %3d ", (*rp)->user_number); + fprintf (stderr, " %3d ", (*rp)->code); rule_rhs_print (*rp, stderr); fprintf (stderr, "\n"); } @@ -62,7 +62,7 @@ derives_compute (void) { /* DSET[NTERM - NTOKENS] -- A linked list of the numbers of the rules whose LHS is NTERM. */ - rule_list **dset = xcalloc (nvars, sizeof *dset); + rule_list **dset = xcalloc (nnterms, sizeof *dset); /* DELTS[RULE] -- There are NRULES rule number to attach to nterms. Instead of performing NRULES allocations for each, have an array @@ -82,9 +82,9 @@ derives_compute (void) /* DSET contains what we need under the form of a linked list. Make it a single array. */ - derives = xnmalloc (nvars, sizeof *derives); + derives = xnmalloc (nnterms, sizeof *derives); /* Q is the storage for DERIVES[...] (DERIVES[0] = q). */ - rule **q = xnmalloc (nvars + nrules, sizeof *q); + rule **q = xnmalloc (nnterms + nrules, sizeof *q); for (symbol_number i = ntokens; i < nsyms; ++i) { |