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

ruby-changes:44647

From: nagachika <ko1@a...>
Date: Sat, 12 Nov 2016 01:02:49 +0900 (JST)
Subject: [ruby-changes:44647] nagachika:r56720 (ruby_2_3): merge revision(s) 56489: [Backport #12832]

nagachika	2016-11-12 01:02:45 +0900 (Sat, 12 Nov 2016)

  New Revision: 56720

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

  Log:
    merge revision(s) 56489: [Backport #12832]
    
    * proc.c (mnew_internal): follow the original class, not to loop
      the prepended module.  [ruby-core:77591] [Bug #12832]

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/proc.c
    branches/ruby_2_3/test/ruby/test_method.rb
    branches/ruby_2_3/version.h
Index: ruby_2_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 56719)
+++ ruby_2_3/ChangeLog	(revision 56720)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Sat Nov 12 00:50:35 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* proc.c (mnew_internal): follow the original class, not to loop
+	  the prepended module.  [ruby-core:77591] [Bug #12832]
+
 Sat Nov 12 00:46:50 2016  Shugo Maeda  <shugo@r...>
 
 	* cont.c (cont_new): disable optimization if clang's version is
Index: ruby_2_3/test/ruby/test_method.rb
===================================================================
--- ruby_2_3/test/ruby/test_method.rb	(revision 56719)
+++ ruby_2_3/test/ruby/test_method.rb	(revision 56720)
@@ -889,6 +889,22 @@ class TestMethod < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/ruby/test_method.rb#L889
     assert_nil(m, Feature9781)
   end
 
+  def test_prepended_public_zsuper
+    mod = EnvUtil.labeled_module("Mod") {private def foo; :ok end}
+    mods = [mod]
+    obj = Object.new.extend(mod)
+    class << obj
+      public :foo
+    end
+    2.times do |i|
+      mods.unshift(mod = EnvUtil.labeled_module("Mod#{i}") {def foo; end})
+      obj.singleton_class.prepend(mod)
+    end
+    m = obj.method(:foo)
+    assert_equal(mods, mods.map {m.owner.tap {m = m.super_method}})
+    assert_nil(m)
+  end
+
   def rest_parameter(*rest)
     rest
   end
Index: ruby_2_3/proc.c
===================================================================
--- ruby_2_3/proc.c	(revision 56719)
+++ ruby_2_3/proc.c	(revision 56720)
@@ -1296,7 +1296,7 @@ mnew_internal(const rb_method_entry_t *m https://github.com/ruby/ruby/blob/trunk/ruby_2_3/proc.c#L1296
     }
     if (me->def->type == VM_METHOD_TYPE_ZSUPER) {
 	if (me->defined_class) {
-	    VALUE klass = RCLASS_SUPER(me->defined_class);
+	    VALUE klass = RCLASS_SUPER(RCLASS_ORIGIN(me->defined_class));
 	    id = me->def->original_id;
 	    me = (rb_method_entry_t *)rb_callable_method_entry_without_refinements(klass, id);
 	}
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 56719)
+++ ruby_2_3/version.h	(revision 56720)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.2"
 #define RUBY_RELEASE_DATE "2016-11-12"
-#define RUBY_PATCHLEVEL 209
+#define RUBY_PATCHLEVEL 210
 
 #define RUBY_RELEASE_YEAR 2016
 #define RUBY_RELEASE_MONTH 11

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r56489


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

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