Avoid calling mrb_gv_set() from mrb_gc_unregister()

Should simply be ignored for the possibility of being called from `RData::dfree`.
This commit is contained in:
dearblue
2024-10-19 11:08:32 +09:00
parent c3be2568ea
commit 1dcc2cac03
+1 -5
View File
@@ -448,11 +448,7 @@ mrb_gc_unregister(mrb_state *mrb, mrb_value obj)
if (mrb_immediate_p(obj)) return;
table = mrb_gv_get(mrb, GC_ROOT_SYM);
if (mrb_nil_p(table)) return;
if (!mrb_array_p(table)) {
mrb_gv_set(mrb, GC_ROOT_SYM, mrb_nil_value());
return;
}
if (!mrb_array_p(table)) return;
a = mrb_ary_ptr(table);
mrb_ary_modify(mrb, a);
for (mrb_int i = 0; i < ARY_LEN(a); i++) {