Protect Fiber from GC in `ecall()`; fix #4104

parent 25d390d6
...@@ -364,6 +364,9 @@ ecall(mrb_state *mrb) ...@@ -364,6 +364,9 @@ ecall(mrb_state *mrb)
if (exc) { if (exc) {
mrb_gc_protect(mrb, mrb_obj_value(exc)); mrb_gc_protect(mrb, mrb_obj_value(exc));
} }
if (mrb->c->fib) {
mrb_gc_protect(mrb, mrb_obj_value(mrb->c->fib));
}
mrb_run(mrb, p, env->stack[0]); mrb_run(mrb, p, env->stack[0]);
mrb->c = c; mrb->c = c;
c->ci = c->cibase + cioff; c->ci = c->cibase + cioff;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment