summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-08-12 00:51:41 +0200
committerJo-Philipp Wich <jo@mein.io>2022-08-12 01:03:00 +0200
commit381cc7508f797e5158bbd1620d6154ef4a11b76c (patch)
treed336aa85dd93f4fc59c49c6502ac1877cc8948cf
parentd0ae9106307343298c926ed065c19609aa37a001 (diff)
types: treat vm->exports as GC roots
We must not free objects being in the module export registry. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--types.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/types.c b/types.c
index 3a3e35c..983bda3 100644
--- a/types.c
+++ b/types.c
@@ -2220,6 +2220,9 @@ ucv_gc_common(uc_vm_t *vm, bool final)
for (i = 0; i < vm->restypes.count; i++)
ucv_gc_mark(vm->restypes.entries[i]->proto);
+
+ for (i = 0; i < vm->exports.count; i++)
+ ucv_gc_mark(vm->exports.entries[i]->value);
}
/* unref unreachable objects */