mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
@@ -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, ":");
|
||||
|
||||
Reference in New Issue
Block a user