summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-03 16:07:15 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-03 16:07:15 +0000
commit84091a71e50ebe37f2261762fcef97cefe4c93ab (patch)
treec1d5605d2d06a640869507a7765a83990b9c1b2e /eval.c
parentfe45e6b79c9dcff352327dd5865ed20f528ad83d (diff)
merge revision(s) r46465,r46469,r46484: [Backport #9961]
* vm.c (rb_vm_rewind_cfp): add new function to rewind specified cfp with invoking RUBY_EVENT_C_RETURN. [Bug #9961] * vm_core.h: ditto. * eval.c (rb_protect): use it. * eval.c (rb_rescue2): ditto. * vm_eval.c (rb_iterate): ditto. * test/ruby/test_settracefunc.rb: add a test. * vm_core.h (rb_name_err_mesg_new): * vm_eval.c (rb_catch_protect): fix same problem of [Bug #9961]. * vm_eval.c (rb_iterate): ditto. * vm_core.h (rb_vm_rewind_cfp): add the prototype declaration. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index e58496ecce..7f002270a5 100644
--- a/eval.c
+++ b/eval.c
@@ -763,7 +763,7 @@ rb_rescue2(VALUE (* b_proc) (ANYARGS), VALUE data1,
}
}
else {
- th->cfp = cfp; /* restore */
+ rb_vm_rewind_cfp(th, cfp);
if (state == TAG_RAISE) {
int handle = FALSE;
@@ -822,7 +822,7 @@ rb_protect(VALUE (* proc) (VALUE), VALUE data, int * state)
SAVE_ROOT_JMPBUF(th, result = (*proc) (data));
}
else {
- th->cfp = cfp;
+ rb_vm_rewind_cfp(th, cfp);
}
MEMCPY(&(th)->root_jmpbuf, &org_jmpbuf, rb_jmpbuf_t, 1);
th->protect_tag = protect_tag.prev;