From 8fe9c8a22a0f43c8e34df5bc92df98c498c9a3f4 Mon Sep 17 00:00:00 2001 From: Stephen Dolan Date: Mon, 3 Sep 2012 15:33:59 +0100 Subject: [PATCH] Make assignment work again: = and |= operators. --- c/execute.c | 37 ++++++++++++++++++------------------- c/jv.h | 2 +- c/opcode_list.h | 1 - 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/c/execute.c b/c/execute.c index c22d1df..0c31e07 100644 --- a/c/execute.c +++ b/c/execute.c @@ -24,14 +24,18 @@ int pathsize; // number of allocated elements // FIXME mem int path_push(stackval sv, jv val) { - return 0; int pos = sv.pathidx; assert(pos <= pathsize); assert(pos >= 0); if (pos == pathsize) { - pathsize = pathsize ? pathsize * 2 : 100; + int oldpathsize = pathsize; + pathsize = oldpathsize ? oldpathsize * 2 : 100; pathbuf = realloc(pathbuf, sizeof(pathbuf[0]) * pathsize); + for (int i=oldpathsize; i