X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/c7bd07f75a9ea65907924fa61bbb1e4a8cc025ad..d2ffe11637313569116e8a9f891785b842ddb1e9:/src/closure.c diff --git a/src/closure.c b/src/closure.c index 618846dc..228056f7 100644 --- a/src/closure.c +++ b/src/closure.c @@ -128,9 +128,9 @@ set_firsts (void) firsts = bitsetv_create (nvars, nvars, BITSET_FIXED); for (i = ntokens; i < nsyms; i++) - for (j = 0; derives[i][j]; ++j) + for (j = 0; derives[i - ntokens][j]; ++j) { - item_number sym = derives[i][j]->rhs[0]; + item_number sym = derives[i - ntokens][j]->rhs[0]; if (ISVAR (sym)) bitset_set (FIRSTS (i), sym - ntokens); } @@ -168,8 +168,8 @@ set_fderives (void) for (i = ntokens; i < nsyms; ++i) for (j = ntokens; j < nsyms; ++j) if (bitset_test (FIRSTS (i), j - ntokens)) - for (k = 0; derives[j][k]; ++k) - bitset_set (FDERIVES (i), derives[j][k]->number); + for (k = 0; derives[j - ntokens][k]; ++k) + bitset_set (FDERIVES (i), derives[j - ntokens][k]->number); if (trace_flag & trace_sets) print_fderives (); @@ -182,7 +182,7 @@ set_fderives (void) void new_closure (int n) { - itemset = XCALLOC (item_number, n); + CALLOC (itemset, n); ruleset = bitset_create (nrules, BITSET_FIXED);