Consider proc to be GC'ed if fiber is terminated

When fiber is terminated, the pointer indicated by `f->cxt->cibase->proc` is not protected from GC.
I should have done this patch way as of commit 9af6264d6b (#6105).
This commit is contained in:
dearblue
2023-12-09 15:55:19 +09:00
parent 34346e75a4
commit c0b5bc4ae8
+1 -1
View File
@@ -382,7 +382,7 @@ fiber_to_s(mrb_state *mrb, mrb_value self)
const char *file;
int32_t line;
const struct RProc *p = f->cxt->cibase->proc;
if (!MRB_PROC_CFUNC_P(p) && !MRB_PROC_ALIAS_P(p) &&
if (f->cxt->status != MRB_FIBER_TERMINATED && !MRB_PROC_CFUNC_P(p) && !MRB_PROC_ALIAS_P(p) &&
mrb_debug_get_position(mrb, p->body.irep, 0, &line, &file)) {
mrb_str_cat_cstr(mrb, s, file);
mrb_str_cat_lit(mrb, s, ":");