]> git.mdlowis.com Git - projs/onward.git/commitdiff
fixed bug in the comma word and cleaned up the create word
authorMichael D. Lowis <mike@mdlowis.com>
Sat, 22 Nov 2014 03:49:12 +0000 (22:49 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Sat, 22 Nov 2014 03:49:12 +0000 (22:49 -0500)
source/onward/onward.c

index f31b92e70abb2baea96ed5eecc0e97e1c7c2ad5d..a040f53701192df08ca9bb534fdc58255670b956 100755 (executable)
@@ -194,15 +194,16 @@ defcode("create", create, &exec, 0u) {
     ((word_t*)here)->name  = name;
     ((word_t*)here)->code  = (value_t*)(((word_t*)here) + 1);
     /* Update latest and here variables and initialize the code array */
-    latest = here;
-    here   = (value_t)(((word_t*)here) + 1);
+    latest  = here;
+    here   += sizeof(word_t);
     *((value_t*)here) = 0u;
 }
 
 /** Append a word to the latest word definition */
 defcode(",", comma, &create, 0u) {
-    *((value_t*)here++) = onward_aspop();
-    *((value_t*)here)   = 0u;
+    *((value_t*)here)  = onward_aspop();
+    here              += sizeof(value_t);
+    *((value_t*)here)  = 0u;
 }
 
 /** Set the interpreter mode to "interpret" */