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

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-03-01 12:58:31 +09:00
parent bed4dcb162
commit 8e170ce915
+11 -2
View File
@@ -1300,8 +1300,17 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int
}
else if (ci == mrb->c->cibase) {
if (ci->ridx == 0) {
regs = mrb->c->stack = mrb->c->stbase;
goto L_STOP;
if (mrb->c == mrb->root_c) {
regs = mrb->c->stack = mrb->c->stbase;
goto L_STOP;
}
else {
struct mrb_context *c = mrb->c;
mrb->c = c->prev;
c->prev = NULL;
goto L_RAISE;
}
}
break;
}