Invoke ensure clauses on Fiber termination; fix #3666

Related to #3662
This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-05-26 10:50:51 +09:00
parent 83fc915213
commit e3438f404a
+3
View File
@@ -1848,6 +1848,9 @@ RETRY_TRY_BLOCK:
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;