[前][次][番号順一覧][スレッド一覧]

ruby-changes:38203

From: usa <ko1@a...>
Date: Mon, 13 Apr 2015 16:49:08 +0900 (JST)
Subject: [ruby-changes:38203] usa:r50284 (ruby_2_1): merge revision(s) 49867: [Backport #10847] [Backport #10970]

usa	2015-04-13 16:48:58 +0900 (Mon, 13 Apr 2015)

  New Revision: 50284

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50284

  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_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/test/ruby/test_module.rb
    branches/ruby_2_1/version.h
    branches/ruby_2_1/vm_eval.c
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 50283)
+++ ruby_2_1/ChangeLog	(revision 50284)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Mon Apr 13 16:48:14 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 16:39:57 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (arg): fix segfault by null caused by syntax error.
Index: ruby_2_1/vm_eval.c
===================================================================
--- ruby_2_1/vm_eval.c	(revision 50283)
+++ ruby_2_1/vm_eval.c	(revision 50284)
@@ -260,7 +260,8 @@ vm_call_super(rb_thread_t *th, int argc, https://github.com/ruby/ruby/blob/trunk/ruby_2_1/vm_eval.c#L260
 	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_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 50283)
+++ ruby_2_1/version.h	(revision 50284)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.5"
 #define RUBY_RELEASE_DATE "2015-04-13"
-#define RUBY_PATCHLEVEL 330
+#define RUBY_PATCHLEVEL 331
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 4
Index: ruby_2_1/test/ruby/test_module.rb
===================================================================
--- ruby_2_1/test/ruby/test_module.rb	(revision 50283)
+++ ruby_2_1/test/ruby/test_module.rb	(revision 50284)
@@ -1708,6 +1708,17 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/ruby/test_module.rb#L1708
     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_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r49867


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]