From: Michael D. Lowis Date: Mon, 21 Apr 2014 22:34:21 +0000 (-0400) Subject: Fixed updating of here value after comma execution X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=ce2fefb1de873b59735a86d76f75c07ef5fedb22;p=proto%2Fsclpl.git Fixed updating of here value after comma execution --- 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; }