summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-19 20:27:59 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-19 20:27:59 +0000
commit15397de07d599c17f6d6ffaaf02f84318247a3c0 (patch)
treef8bf12e16b621617929d00d0f25c2fa378868a4e /vm_eval.c
parent3f3c86faaa83f928c902249b0f67d68e7f9fae20 (diff)
* vm_eval.c (rb_catch_protect): fix same problem of [Bug #9961].
* vm_eval.c (rb_iterate): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/vm_eval.c b/vm_eval.c
index 5d05952bcf..b53f9bc0f1 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1104,10 +1104,11 @@ rb_iterate(VALUE (* it_proc) (VALUE), VALUE data1,
VALUE *cep = cfp->ep;
if (cep == escape_ep) {
+ rb_vm_rewind_cfp(th, cfp);
+
state = 0;
th->state = 0;
th->errinfo = Qnil;
- th->cfp = cfp;
goto iter_retry;
}
}
@@ -1863,7 +1864,7 @@ rb_catch_protect(VALUE t, rb_block_call_func *func, VALUE data, int *stateptr)
val = (*func)(tag, data, 1, (const VALUE *)&tag, Qnil);
}
else if (state == TAG_THROW && RNODE(th->errinfo)->u1.value == tag) {
- th->cfp = saved_cfp;
+ rb_vm_rewind_cfp(th, saved_cfp);
val = th->tag->retval;
th->errinfo = Qnil;
state = 0;