ruby-changes:38194
From: nagachika <ko1@a...>
Date: Mon, 13 Apr 2015 00:42:19 +0900 (JST)
Subject: [ruby-changes:38194] nagachika:r50275 (ruby_2_2): merge revision(s) 49867: [Backport #10847] [Backport #10970]
nagachika 2015-04-13 00:41:32 +0900 (Mon, 13 Apr 2015) New Revision: 50275 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50275 Log: merge revision(s) 49867: [Backport #10847] [Backport #10970] * 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] Modified directories: branches/ruby_2_2/ Modified files: branches/ruby_2_2/ChangeLog branches/ruby_2_2/test/ruby/test_module.rb branches/ruby_2_2/version.h branches/ruby_2_2/vm_eval.c Index: ruby_2_2/ChangeLog =================================================================== --- ruby_2_2/ChangeLog (revision 50274) +++ ruby_2_2/ChangeLog (revision 50275) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Mon Apr 13 00:16:32 2015 Nobuyoshi Nakada <nobu@r...> + + * 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] + Mon Apr 13 00:09:48 2015 Koichi Sasada <ko1@a...> * class.c (rb_prepend_module): need a WB for klass -> origin. Index: ruby_2_2/vm_eval.c =================================================================== --- ruby_2_2/vm_eval.c (revision 50274) +++ ruby_2_2/vm_eval.c (revision 50275) @@ -273,7 +273,8 @@ vm_call_super(rb_thread_t *th, int argc, https://github.com/ruby/ruby/blob/trunk/ruby_2_2/vm_eval.c#L273 rb_bug("vm_call_super: should not be reached"); } - klass = RCLASS_SUPER(cfp->klass); + klass = RCLASS_ORIGIN(cfp->klass); + klass = RCLASS_SUPER(klass); id = cfp->me->def->original_id; me = rb_method_entry(klass, id, &klass); if (!me) { Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 50274) +++ ruby_2_2/version.h (revision 50275) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.2" #define RUBY_RELEASE_DATE "2015-04-13" -#define RUBY_PATCHLEVEL 90 +#define RUBY_PATCHLEVEL 91 #define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_MONTH 4 Index: ruby_2_2/test/ruby/test_module.rb =================================================================== --- ruby_2_2/test/ruby/test_module.rb (revision 50274) +++ ruby_2_2/test/ruby/test_module.rb (revision 50275) @@ -1725,6 +1725,17 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_module.rb#L1725 assert_equal('hello!', foo.new.hello, bug9236) 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) Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r49867 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/