diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-07-20 09:22:40 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-07-30 00:41:56 +0200 |
commit | 341896786c604d3f37e3095cdef16d786192f014 (patch) | |
tree | f5649f740110257ef180b3b3fc4c67dd05b74538 | |
parent | 50cf5723f9d41a5a65a6f5d38f8dfff4ff9422a5 (diff) |
vm: gracefully handle unresolved upvalues
Upcoming module support will rely on upresolved upvalues which are patched
at runtime to realize module imports, make sure the VM trace code does not
choke on such unresolved upvalues.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | vm.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -345,7 +345,10 @@ uc_vm_frame_dump(uc_vm_t *vm, uc_callframe_t *frame) fprintf(stderr, " [%zu] <%p> %s ", i, (void *)ref, uc_vm_format_val(vm, v)); - if (ref->closed) { + if (!ref) { + fprintf(stderr, "{unresolved}\n"); + } + else if (ref->closed) { fprintf(stderr, "{closed} %s\n", uc_vm_format_val(vm, ref->value)); } |