Save&restore execution point (`pc`) in `c->cibase->pc`; fix
`mrb_fiber_resume()` can be called from C; ref
MODIFY
mrbgems/mruby-fiber/src/fiber.c
mrbgems/mruby-fiber/src/fiber.c
@@ -231,7 +231,7 @@ fiber_switch(mrb_state *mrb, mrb_value self, mrb_int len, const mrb_value *a, mr
if (vmexec) {
c->vmexec = TRUE;
- value = mrb_vm_exec(mrb, c->ci->proc, c->ci->pc);
+ value = mrb_vm_exec(mrb, c->ci->proc, c->cibase->pc);
mrb->c = old_c;
}
else {
@@ -357,6 +357,7 @@ mrb_fiber_yield(mrb_state *mrb, mrb_int len, const mrb_value *a)
if (c->vmexec) {
c->vmexec = FALSE;
mrb->c->ci->acc = CI_ACC_RESUMED;
+ c->cibase->pc = c->ci->pc;
c->ci--; /* pop callinfo for yield */
}
MARK_CONTEXT_MODIFY(mrb->c);

Save&restore execution point (`pc`) in `c->cibase->pc`; fix #5261

`mrb_fiber_resume()` can be called from C; ref #3056