Skip to content
Permalink
Browse files
Unwind callinfo (mrb->c->ci) when a fiber termitates with error.
Fix #3668
  • Loading branch information
matz committed May 27, 2017
1 parent 57ffa1c commit 34dd258c638bfc9e8ffac6621f3918faff3d797f
Showing 1 changed file with 4 additions and 0 deletions.
@@ -850,6 +850,7 @@ mrb_vm_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int stac
mrb_irep *irep = proc->body.irep;
mrb_value result;
struct mrb_context *c = mrb->c;
int cioff = c->ci - c->cibase;

if (!c->stack) {
stack_init(mrb);
@@ -859,6 +860,9 @@ mrb_vm_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int stac
stack_extend(mrb, stack_keep);
c->stack[0] = self;
result = mrb_vm_exec(mrb, proc, irep->iseq);
if (c->ci - c->cibase > cioff) {
c->ci = c->cibase + cioff;
}
mrb->c = c;
return result;
}

0 comments on commit 34dd258

Please sign in to comment.