summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-06 01:31:03 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-06 01:31:03 +0000
commit3e557a979ecc2c9a43ffa3bbdb8fc2a6c5cfca61 (patch)
treed55326333b9d38bc86e72cf7a0de337522f85921 /test
parentb81950f480df1c07f2e6f271d23d066dafdc0e1f (diff)
vm_eval.c: next super class from the original
* vm_eval.c (vm_call_super): search next super class from the original class, to get rid of infinite recursion with prepending. a patch by Seiei Higa <hanachin AT gmail.com> at [ruby-core:68434]. [ruby-core:68093] [Bug #10847] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_module.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index d014e8cb05..f1ca0b7cc1 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -1748,6 +1748,17 @@ class TestModule < Test::Unit::TestCase
assert_equal([m, c2, m, c1], c2.ancestors[0, 4], "should accesisble prepended module in superclass")
end
+ def test_prepend_call_super
+ assert_separately([], <<-'end;') #do
+ bug10847 = '[ruby-core:68093] [Bug #10847]'
+ module M; end
+ Float.prepend M
+ assert_nothing_raised(SystemStackError, bug10847) do
+ 0.3.numerator
+ end
+ end;
+ end
+
def test_class_variables
m = Module.new
m.class_variable_set(:@@foo, 1)