From b10c3b6d51d7fb0597670d88a537d713b445098e Mon Sep 17 00:00:00 2001 From: usa Date: Sun, 31 Aug 2014 08:14:15 +0000 Subject: merge revision(s) 46465,46469,46484: [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_0_0@47342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index c682a8358d..ec563bc4f7 100644 --- a/eval.c +++ b/eval.c @@ -714,7 +714,7 @@ rb_rescue2(VALUE (* b_proc) (ANYARGS), VALUE data1, result = (*b_proc) (data1); } else { - th->cfp = cfp; /* restore */ + rb_vm_rewind_cfp(th, cfp); if (state == TAG_RAISE) { int handle = FALSE; @@ -793,7 +793,7 @@ rb_protect(VALUE (* proc) (VALUE), VALUE data, int * state) *state = status; } if (status != 0) { - th->cfp = cfp; + rb_vm_rewind_cfp(th, cfp); return Qnil; } -- cgit v1.2.3