From 3e557a979ecc2c9a43ffa3bbdb8fc2a6c5cfca61 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 6 Mar 2015 01:31:03 +0000 Subject: 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 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 --- test/ruby/test_module.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') 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) -- cgit v1.2.3