]> git.mdlowis.com Git - proto/sclpl.git/commitdiff
Fixed updating of here value after comma execution
authorMichael D. Lowis <mike@mdlowis.com>
Mon, 21 Apr 2014 22:34:21 +0000 (18:34 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Mon, 21 Apr 2014 22:34:21 +0000 (18:34 -0400)
source/slvm/main.c

index 78de55185f12a99cd274f6f45c44c2bcb4aad5f5..7daa829bc1d1ca23fecc658d9457ad46b5349a15 100644 (file)
@@ -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;
 }