]> Chaos Git - corbenik/corbenik.git/commitdiff
I goofed when updating the find opcode, fix failure
authorchaoskagami <chaos.kagami@gmail.com>
Sat, 11 Jun 2016 18:23:39 +0000 (14:23 -0400)
committerchaoskagami <chaos.kagami@gmail.com>
Sat, 11 Jun 2016 18:23:39 +0000 (14:23 -0400)
source/interp.c

index 5d37a53da408b8dbf6a36d14b1e6e6ae1182f5e3..fecb7b59bf37c8d1c4a94790ed15ed55b3762579 100644 (file)
@@ -170,8 +170,8 @@ exec_bytecode(uint8_t *bytecode, uint16_t ver, uint32_t len, int debug)
                 if ((uint8_t *)new_offset != NULL) {
                     // Pattern found, set found state flag
                     found = 1;
+                    offset = new_offset - (uint32_t)current_mode->memory;
                 }
-                offset = offset - (uint32_t)current_mode->memory;
                 code += *(code - 1);
                 break;
             case OP_BACK:
@@ -394,10 +394,10 @@ exec_bytecode(uint8_t *bytecode, uint16_t ver, uint32_t len, int debug)
         }
 
         if (offset > current_mode->size) { // Went out of bounds. Error.
+            abort("seeked out of bounds\n");
 #ifndef LOADER
-            fprintf(stderr, "%x", offset);
+            fprintf(stderr, " -> %x", offset);
 #endif
-            abort("seeked out of bounds\n");
         }
 
 #ifndef LOADER