summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-05-25 14:36:25 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-05-25 14:36:25 +0900
commit517cd51cea4bcc61444b02861f3e0d8cb93b6383 (patch)
tree5c0ab17cdfd4242f87ee9fd2f063df66eaacb6e6 /src
parented16535c73b9eb763e445e23489e7a73144f6f09 (diff)
downloadmruby-517cd51cea4bcc61444b02861f3e0d8cb93b6383.tar.gz
mruby-517cd51cea4bcc61444b02861f3e0d8cb93b6383.zip
Invoke ensure clauses before switching context from fibers; fix #3662
Diffstat (limited to 'src')
-rw-r--r--src/vm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vm.c b/src/vm.c
index 23e20b826..6d4aac147 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -1870,6 +1870,9 @@ RETRY_TRY_BLOCK:
if (mrb->c->ci == mrb->c->cibase && mrb->c->ci->pc) {
struct mrb_context *c = mrb->c;
+ while (eidx > 0) {
+ ecall(mrb, --eidx);
+ }
mrb->c = c->prev;
c->prev = NULL;
ci = mrb->c->ci;