From 05bd7edd7a101aa09a54371aa34bc22646b75bee Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 3 Mar 2022 11:51:56 +0100 Subject: types: treat resource type prototypes as GC roots Mark reachable resource type prototype objects during incremental GC steps in order to avoid freeing them prematurely. Signed-off-by: Jo-Philipp Wich --- types.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types.c b/types.c index a8de8e4..6f60f59 100644 --- a/types.c +++ b/types.c @@ -2189,6 +2189,9 @@ ucv_gc_common(uc_vm_t *vm, bool final) for (i = 0; i < vm->stack.count; i++) ucv_gc_mark(vm->stack.entries[i]); + + for (i = 0; i < vm->restypes.count; i++) + ucv_gc_mark(vm->restypes.entries[i]->proto); } /* unref unreachable objects */ -- cgit v1.2.3