aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-11-03 21:21:17 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-11-03 21:21:33 +0000
commit96a83db92b7f81a6fd4701f7b8779494283dd819 (patch)
treec202c1560fa75e56db8a266048a17f69d69ea850
parentfc5393b010ccfe68d399abacc93792fc8b711f79 (diff)
downloadovm-96a83db92b7f81a6fd4701f7b8779494283dd819.tar.gz
ovm-96a83db92b7f81a6fd4701f7b8779494283dd819.tar.bz2
ovm-96a83db92b7f81a6fd4701f7b8779494283dd819.zip
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.
-rw-r--r--vm/runtime.c2
1 files changed, 2 insertions, 0 deletions
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