From 6c2caf9fbb9d346cfb20cd5c83875fdff77e584c Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 13 Jan 2022 16:06:17 +0100 Subject: 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 --- lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib.c') 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; } -- cgit v1.2.3