exception in fiber should make resume to raise in parent fiber context; close #1765

parent bed4dcb1
...@@ -1300,9 +1300,18 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int ...@@ -1300,9 +1300,18 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int
} }
else if (ci == mrb->c->cibase) { else if (ci == mrb->c->cibase) {
if (ci->ridx == 0) { if (ci->ridx == 0) {
if (mrb->c == mrb->root_c) {
regs = mrb->c->stack = mrb->c->stbase; regs = mrb->c->stack = mrb->c->stbase;
goto L_STOP; goto L_STOP;
} }
else {
struct mrb_context *c = mrb->c;
mrb->c = c->prev;
c->prev = NULL;
goto L_RAISE;
}
}
break; break;
} }
} }
......
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