summaryrefslogtreecommitdiffhomepage
path: root/src/vm.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2016-11-07 00:44:08 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2016-11-07 00:44:08 +0900
commit6c299aae67e2e0f13a470b855298bc1efb43387a (patch)
tree4a3509d41c78f428da55e3b4aa966793d624d8d7 /src/vm.c
parent0b8d8dd379fc5df137477019f0ae355d7a01735f (diff)
downloadmruby-6c299aae67e2e0f13a470b855298bc1efb43387a.tar.gz
mruby-6c299aae67e2e0f13a470b855298bc1efb43387a.zip
fixed wrong stack adjustment for ensure clauses; fix #3175
Diffstat (limited to 'src/vm.c')
-rw-r--r--src/vm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vm.c b/src/vm.c
index fcc69a1f9..a7418e6e7 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -1513,6 +1513,7 @@ RETRY_TRY_BLOCK:
/* A B return R(A) (B=normal,in-block return/break) */
if (mrb->exc) {
mrb_callinfo *ci;
+ mrb_value *stk;
int eidx;
L_RAISE:
@@ -1524,6 +1525,7 @@ RETRY_TRY_BLOCK:
if (ci->ridx == 0) goto L_STOP;
goto L_RESCUE;
}
+ stk = mrb->c->stack;
while (ci[0].ridx == ci[-1].ridx) {
cipop(mrb);
ci = mrb->c->ci;
@@ -1533,6 +1535,7 @@ RETRY_TRY_BLOCK:
MRB_THROW(prev_jmp);
}
if (ci == mrb->c->cibase) {
+ mrb->c->stack = stk;
while (eidx > 0) {
ecall(mrb, --eidx);
}