From 92f4f9011d431f9c197aff56a3dbb8a3963b4197 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Fri, 3 Nov 2023 19:10:01 +0000 Subject: Refactor vm/main to use refactor to program structure --- vm/runtime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vm/runtime.c') diff --git a/vm/runtime.c b/vm/runtime.c index 16c75f9..72785c5 100644 --- a/vm/runtime.c +++ b/vm/runtime.c @@ -281,8 +281,8 @@ err_t vm_execute_all(vm_t *vm) size_t prev_pages = 0; size_t prev_cptr = 0; #endif - while (program->data->instructions[program->ptr].opcode != OP_HALT && - program->ptr < program->data->count) + while (program->ptr < program->data->count && + program->data->instructions[program->ptr].opcode != OP_HALT) { #if VERBOSE >= 2 fprintf(stdout, "[vm_execute_all]: Trace(Cycle %lu)\n", cycles); -- cgit v1.2.3-13-gbd6f