From ace1bc71022f8aa0223cf7efcf6f23b4e42e4bdc Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Mon, 7 Oct 2024 14:26:13 -0400 Subject: [PATCH] Don't create final job if dfree is null --- gc/mmtk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gc/mmtk.c b/gc/mmtk.c index 78291f17da5271..5650857626c535 100644 --- a/gc/mmtk.c +++ b/gc/mmtk.c @@ -828,6 +828,8 @@ gc_run_finalizers(void *data) void rb_gc_impl_make_zombie(void *objspace_ptr, VALUE obj, void (*dfree)(void *), void *data) { + if (dfree == NULL) return; + struct objspace *objspace = objspace_ptr; struct MMTk_final_job *job = xmalloc(sizeof(struct MMTk_final_job));