summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-19 12:43:48 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-19 12:43:48 +0000
commitbef2e29aab53d2d15006fad7de9e56f2f44c7778 (patch)
treeae966a2db6bf86622ac22a033dc3a6d25a0bf23a /eval.c
parent370212a8ae39939979cf0651bd98108316a8e535 (diff)
* 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): git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46465 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 7a8dce3..afad73c 100644
--- a/eval.c
+++ b/eval.c
@@ -803,7 +803,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;
@@ -862,7 +862,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;