summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2015-03-05 15:27:26 -0500
committerQuentin Carbonneaux2015-03-05 15:27:26 -0500
commit6b619da0bf69bc50f67a64bd497c5fd00747ccaf (patch)
tree5c24cf7c7c27e8f03c3c8b0e43243636d9cf4dce
parent74b6607ffdbaae67f5bcb8182b40818648add4ec (diff)
have not tested in a while!
-rw-r--r--miniyacc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/miniyacc.c b/miniyacc.c
index d28634b..c9b50d3 100644
--- a/miniyacc.c
+++ b/miniyacc.c
@@ -365,8 +365,9 @@ stadd(Item **pi)
memmove(&st[hi+1], &st[hi], (nst-1 - hi) * sizeof st[0]);
i->gtbl = yalloc(nsy, sizeof i->gtbl[0]);
i->dirty = 1;
- st[hi] = yalloc(1, sizeof *i1);
- *st[hi] = *i;
+ i1 = yalloc(1, sizeof *i1);
+ *i1 = *i;
+ *pi = st[hi] = i1;
return 1;
}
}