aboutsummaryrefslogtreecommitdiffstats
path: root/vm_eval.c
diff options
context:
space:
mode:
authorktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-16 02:54:22 +0000
committerktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-16 02:54:22 +0000
commite62a99b924a9b629eca48bfa3f74d1965bc0ecad (patch)
treed3627ccb92d1795c232ddf0dfa8787173571a1ca /vm_eval.c
parent10fe26fe29681e1b33ee9881efab8e21a7b4fc4d (diff)
downloadruby-e62a99b924a9b629eca48bfa3f74d1965bc0ecad.tar.gz
* eval_intern.h, vm.c, vm_eval.c, vm_insnhelper.c:
change throw mechanism (not save target ep, but save target cfp). It fixes `unexpected break' bug that occurs when TracePoint#binding is called. [ruby-dev:48797] [Bug #10689] * test/ruby/test_settracefunc.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/vm_eval.c b/vm_eval.c
index 49ca9d4191..a58eefe933 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1100,10 +1100,9 @@ rb_iterate(VALUE (* it_proc) (VALUE), VALUE data1,
else {
VALUE err = th->errinfo;
if (state == TAG_BREAK) {
- VALUE *escape_ep = GET_THROWOBJ_CATCH_POINT(err);
- VALUE *cep = cfp->ep;
+ rb_control_frame_t *escape_cfp = GET_THROWOBJ_CATCH_POINT(err);
- if (cep == escape_ep) {
+ if (cfp == escape_cfp) {
state = 0;
th->state = 0;
th->errinfo = Qnil;
@@ -1116,10 +1115,9 @@ rb_iterate(VALUE (* it_proc) (VALUE), VALUE data1,
}
}
else if (state == TAG_RETRY) {
- VALUE *escape_ep = GET_THROWOBJ_CATCH_POINT(err);
- VALUE *cep = cfp->ep;
+ rb_control_frame_t *escape_cfp = GET_THROWOBJ_CATCH_POINT(err);
- if (cep == escape_ep) {
+ if (cfp == escape_cfp) {
rb_vm_rewind_cfp(th, cfp);
state = 0;