From ce2fefb1de873b59735a86d76f75c07ef5fedb22 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 21 Apr 2014 18:34:21 -0400 Subject: [PATCH] Fixed updating of here value after comma execution --- source/slvm/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/slvm/main.c b/source/slvm/main.c index 78de551..7daa829 100644 --- a/source/slvm/main.c +++ b/source/slvm/main.c @@ -281,9 +281,9 @@ defcode(",", comma, 0, 0, &create){ ArgStackPtr--; /* Resize the code section and relocate if necessary */ word->flags.codesize++; - word->code = (long*)realloc(word->code, word->flags.codesize * sizeof(long)); + word->code = (long*)realloc(word->code, word->flags.codesize * sizeof(long)); /* Update "here" and terminate the code section */ - here_val = (long)(((long*)here_val) + 1); + here_val = (long)(&word->code[word->flags.codesize-1]); *((long*)here_val) = (long)&ret; } -- 2.55.0