From 96a83db92b7f81a6fd4701f7b8779494283dd819 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Fri, 3 Nov 2023 21:21:17 +0000 Subject: Fixed bug where runtime would not start program at the right place In vm_execute_all set the program pointer to the start address in the header of the program payload. --- vm/runtime.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vm/runtime.c b/vm/runtime.c index 72785c5..7b712f2 100644 --- a/vm/runtime.c +++ b/vm/runtime.c @@ -272,6 +272,8 @@ err_t vm_execute_all(vm_t *vm) { struct Program *program = &vm->program; err_t err = ERR_OK; + // Setup the initial address according to the program + program->ptr = program->data->header.start_address; #if VERBOSE >= 1 size_t cycles = 0; #endif -- cgit v1.2.3-13-gbd6f