summaryrefslogtreecommitdiffhomepage
path: root/vm.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-07-20 00:12:08 +0200
committerJo-Philipp Wich <jo@mein.io>2022-07-30 00:41:56 +0200
commitc441f65c19e62eefaa8af37ae74ae47c4d4eaa4e (patch)
treececea2c2870311d7abc4c741bb1b38a5dc1ca454 /vm.c
parent23224687205076604c1e0e5829690a5b6e150c06 (diff)
program: add infrastructure to handle multiple sources per program
The upcoming module support requires maintaining multiple source objects within the same program, so add the necessary infrastructure for it. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm.c b/vm.c
index 29ace38..0529ee3 100644
--- a/vm.c
+++ b/vm.c
@@ -211,7 +211,7 @@ uc_vm_frame_program(uc_callframe_t *frame)
static uc_source_t *
uc_vm_frame_source(uc_callframe_t *frame)
{
- return frame->closure ? frame->closure->function->program->source : NULL;
+ return frame->closure ? uc_program_function_source(frame->closure->function) : NULL;
}
static uc_callframe_t *
@@ -829,7 +829,7 @@ uc_vm_capture_stacktrace(uc_vm_t *vm, size_t i)
if (frame->closure) {
function = frame->closure->function;
- source = function->program->source;
+ source = uc_program_function_source(function);
off = (frame->ip - uc_vm_frame_chunk(frame)->entries) - 1;
srcpos = uc_program_function_srcpos(function, off);