* 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
This commit is contained in:
ko1 2014-06-19 20:27:59 +00:00
parent 3f3c86faaa
commit 15397de07d
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,9 @@
Fri Jun 20 05:26:27 2014 Koichi Sasada <ko1@atdot.net>
* vm_eval.c (rb_catch_protect): fix same problem of [Bug #9961].
* vm_eval.c (rb_iterate): ditto.
Thu Jun 19 21:41:30 2014 Koichi Sasada <ko1@atdot.net>
* vm.c (rb_vm_rewind_cfp): add new function to rewind specified cfp

View File

@ -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;