diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-08-04 09:36:04 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-08-05 15:50:13 +0200 |
commit | d62e3725892a29b1e4407243bafc56916267cc27 (patch) | |
tree | 0fa5dbef197dec19bef24ebe114322d9bb231f6c /vm.c | |
parent | b856602250b14a4df1180cf4bd744ce52e477046 (diff) |
vm: don't initialize upvalues for module functions
Module function upvalues are patched through import operations, ensure to
leave them uninitialized when loading and executing the module constructor.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1179,6 +1179,9 @@ uc_vm_insn_load_closure(uc_vm_t *vm, uc_vm_insn_t insn) uc_vm_stack_push(vm, &closure->header); + if (function->module) + return; + for (i = 0; i < function->nupvals; i++) { uv = ( frame->ip[0] * 0x1000000 + |