summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-07 10:03:32 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-07 10:03:32 +0000
commitc88e3861e16c4a0cbf8e4ffb0bca4be193fa1268 (patch)
tree131c64c287aa311da6b62dcb0d2623d4acbde720 /vm_insnhelper.c
parentdf273d60d51a15452292f7fd111f685e7471e588 (diff)
merges 32227 from trunk into ruby_1_9_2.
-- * vm_insnhelper.c (vm_search_superclass): avoid control frame stack overrun. currently super() in Proc created in a method defined by Module#define_method raise NoMethodError. [Bug #4881] * test/ruby/test_method.rb t_super_in_proc_from_define_method): add test for it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@32881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 6b78394ca2..26664ddc13 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1401,9 +1401,14 @@ vm_search_superclass(rb_control_frame_t *reg_cfp, rb_iseq_t *ip,
}
while (lcfp->iseq != ip) {
+ rb_thread_t *th = GET_THREAD();
VALUE *tdfp = GET_PREV_DFP(lcfp->dfp);
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");
+ }
if (lcfp->dfp == tdfp) {
break;
}