Skip to content

Commit

Permalink
Invoke ensure clauses on Fiber termination; fix #3666
Browse files Browse the repository at this point in the history
Related to #3662
  • Loading branch information
matz committed May 26, 2017
1 parent 83fc915 commit e3438f4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1848,6 +1848,9 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
mrb_exc_set(mrb, exc);
goto L_RAISE;
}
while (eidx > 0) {
ecall(mrb, --eidx);
}
/* automatic yield at the end */
mrb->c->status = MRB_FIBER_TERMINATED;
mrb->c = mrb->c->prev;
Expand Down

0 comments on commit e3438f4

Please sign in to comment.