summaryrefslogtreecommitdiffhomepage
path: root/lib.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-01-13 16:06:17 +0100
committerJo-Philipp Wich <jo@mein.io>2022-01-18 10:58:11 +0100
commit6c2caf9fbb9d346cfb20cd5c83875fdff77e584c (patch)
tree4d0fe816584e8f351ed0f1da8be0b9ccf1c5635f /lib.c
parent725bb75b7b66dd1e0a381908e831cede0402cb6e (diff)
source: refactor source file handling
- Move source object pointer into program entity which is referenced by each function - Move lineinfo related routines into source.c and use them from lexer.c since lineinfo encoding does not belong into the lexical analyzer. - Implement initial infrastructure for detecting source file type, this is required later to differentiate between plaintext and precompiled bytecode files Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index 7ded088..0e77b23 100644
--- a/lib.c
+++ b/lib.c
@@ -2093,7 +2093,7 @@ uc_include(uc_vm_t *vm, size_t nargs)
if (!closure)
return NULL;
- p = include_path(closure->function->source->filename, ucv_string_get(path));
+ p = include_path(closure->function->program->source->filename, ucv_string_get(path));
if (!p) {
uc_vm_raise_exception(vm, EXCEPTION_RUNTIME,
@@ -2505,7 +2505,7 @@ uc_sourcepath(uc_vm_t *vm, size_t nargs)
continue;
}
- path = realpath(frame->closure->function->source->filename, NULL);
+ path = realpath(frame->closure->function->program->source->filename, NULL);
break;
}