Permalink
Browse files

Exceptions in fibers must be re-raised via `#resume`; fix #3675

  • Loading branch information...
matz committed May 30, 2017
1 parent cbd4aae commit 650cfb9e4cf52b9bf9ebfb9f1a6259a3d7c8cc3d
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/vm.c
View
@@ -1759,7 +1759,7 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
ci0 = ci = mrb->c->ci;
eidx = ci->eidx;
if (ci == mrb->c->cibase) {
if (ci->ridx == 0) goto L_STOP;
if (ci->ridx == 0) goto L_FTOP;
goto L_RESCUE;
}
stk = mrb->c->stack;
@@ -1774,6 +1774,7 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
if (ci == mrb->c->cibase) {
mrb->c->stack = stk;
if (ci->ridx == 0) {
L_FTOP: /* fiber top */
if (mrb->c == mrb->root_c) {
mrb->c->stack = mrb->c->stbase;
goto L_STOP;

0 comments on commit 650cfb9

Please sign in to comment.