diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-09-25 00:59:29 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-09-25 00:59:29 +0000 |
commit | 1e56548995fe2b3b266ccdfecce0ef1163534dc6 (patch) | |
tree | 6385c62c3281772a716b3b40957164618f7dde2a /vm_insnhelper.c | |
parent | 80440ed07f23c2f6a53e210f84aa2d4ca7f92555 (diff) | |
download | ruby-1e56548995fe2b3b266ccdfecce0ef1163534dc6.tar.gz |
insns.def: super from at_exit
* insns.def (invokesuper): klass in cfp is not valid in at_exit and
END blocks. [ruby-core:47680] [Bug #7064]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index f6125c734d..46ef7e1a1c 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1460,6 +1460,12 @@ vm_search_normal_superclass(VALUE klass) } static void +vm_super_outside(void) +{ + rb_raise(rb_eNoMethodError, "super called outside of method"); +} + +static void vm_search_superclass(rb_control_frame_t *reg_cfp, rb_iseq_t *iseq, VALUE sigval, ID *idp, VALUE *klassp) @@ -1472,7 +1478,7 @@ vm_search_superclass(rb_control_frame_t *reg_cfp, rb_iseq_t *iseq, } if (iseq == 0) { - rb_raise(rb_eNoMethodError, "super called outside of method"); + vm_super_outside(); } id = iseq->defined_method_id; @@ -1492,8 +1498,7 @@ vm_search_superclass(rb_control_frame_t *reg_cfp, rb_iseq_t *iseq, while (1) { lcfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(lcfp); if (RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, lcfp)) { - rb_raise(rb_eNoMethodError, - "super called outside of method"); + vm_super_outside(); } if (lcfp->ep == tep) { break; @@ -1503,7 +1508,7 @@ vm_search_superclass(rb_control_frame_t *reg_cfp, rb_iseq_t *iseq, /* temporary measure for [Bug #2420] [Bug #3136] */ if (!lcfp->me) { - rb_raise(rb_eNoMethodError, "super called outside of method"); + vm_super_outside(); } id = lcfp->me->def->original_id; |