summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2015-03-04 18:45:38 -0500
committerQuentin Carbonneaux2015-03-04 18:45:38 -0500
commitd90dd7d7d862e842df03ea0f943422cdf0a48e3e (patch)
tree154f8fece34d365e0cfdc0852e55427ec6406f9e
parentdedc9f5d9228719c36405d74cc65ab545a1eecff (diff)
close states before processing them
-rw-r--r--miniyacc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/miniyacc.c b/miniyacc.c
index 51f4cb0..0a878c9 100644
--- a/miniyacc.c
+++ b/miniyacc.c
@@ -355,8 +355,6 @@ stadd(Item **pi)
for (n=0; n<i->nt; n++)
chg |= tsunion(&i1->ts[n].lk, &i->ts[n].lk);
*pi = i1;
- if (chg)
- iclose(i1);
return chg;
} else {
st = realloc(st, ++nst * sizeof st[0]);
@@ -366,7 +364,6 @@ stadd(Item **pi)
i->gtbl = yalloc(nsy, sizeof i->gtbl[0]);
st[hi] = yalloc(1, sizeof *i1);
*st[hi] = *i;
- iclose(st[hi]);
return 1;
}
}
@@ -394,6 +391,7 @@ stgen()
chg = 0;
for (n=0; n<nst; n++) {
i = st[n];
+ iclose(i);
for (s=0; s<nsy; s++) {
igoto(i, s);
i1 = &i0;