summaryrefslogtreecommitdiff
path: root/test
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 /test
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 'test')
-rw-r--r--test/ruby/test_method.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index 3a728e1599..d0eaf6118a 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -211,6 +211,20 @@ class TestMethod < Test::Unit::TestCase
end
end
+ def test_super_in_proc_from_define_method
+ c1 = Class.new {
+ def m
+ :m1
+ end
+ }
+ c2 = Class.new(c1) { define_method(:m) { Proc.new { super() } } }
+ # c2.new.m.call should return :m1, but currently it raise NoMethodError.
+ # see [Bug #4881] and [Bug #3136]
+ assert_raise(NoMethodError) {
+ c2.new.m.call
+ }
+ end
+
def test_clone
o = Object.new
def o.foo; :foo; end