summaryrefslogtreecommitdiffhomepage
path: root/vm.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-08-04 09:36:04 +0200
committerJo-Philipp Wich <jo@mein.io>2022-08-05 15:50:13 +0200
commitd62e3725892a29b1e4407243bafc56916267cc27 (patch)
tree0fa5dbef197dec19bef24ebe114322d9bb231f6c /vm.c
parentb856602250b14a4df1180cf4bd744ce52e477046 (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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index ad5cd44..3a6e39e 100644
--- a/vm.c
+++ b/vm.c
@@ -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 +