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

ruby-changes:50391

From: naruse <ko1@a...>
Date: Wed, 21 Feb 2018 13:36:07 +0900 (JST)
Subject: [ruby-changes:50391] naruse:r62507 (ruby_2_5): merge revision(s) 62115: [Backport #14421]

naruse	2018-02-21 13:36:00 +0900 (Wed, 21 Feb 2018)

  New Revision: 62507

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

  Log:
    merge revision(s) 62115: [Backport #14421]
    
    proc: fix super_method segfault after bind
    
    * proc.c: handle undefined iclass
      [ruby-core:85231] [Bug #14421]
    
    From: Eric Wong <e@8...>

  Modified directories:
    branches/ruby_2_5/
  Modified files:
    branches/ruby_2_5/proc.c
    branches/ruby_2_5/test/ruby/test_method.rb
    branches/ruby_2_5/version.h
Index: ruby_2_5/test/ruby/test_method.rb
===================================================================
--- ruby_2_5/test/ruby/test_method.rb	(revision 62506)
+++ ruby_2_5/test/ruby/test_method.rb	(revision 62507)
@@ -926,6 +926,11 @@ class TestMethod < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_5/test/ruby/test_method.rb#L926
     assert_equal(m1.source_location, m2.source_location, bug)
   end
 
+  def test_super_method_after_bind
+    assert_nil String.instance_method(:length).bind(String.new).super_method,
+      '[ruby-core:85231] [Bug #14421]'
+  end
+
   def rest_parameter(*rest)
     rest
   end
Index: ruby_2_5/proc.c
===================================================================
--- ruby_2_5/proc.c	(revision 62506)
+++ ruby_2_5/proc.c	(revision 62507)
@@ -2720,6 +2720,7 @@ method_super_method(VALUE method) https://github.com/ruby/ruby/blob/trunk/ruby_2_5/proc.c#L2720
 
     TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
     iclass = data->iclass;
+    if (!iclass) return Qnil;
     super_class = RCLASS_SUPER(RCLASS_ORIGIN(iclass));
     mid = data->me->called_id;
     if (!super_class) return Qnil;
Index: ruby_2_5/version.h
===================================================================
--- ruby_2_5/version.h	(revision 62506)
+++ ruby_2_5/version.h	(revision 62507)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_5/version.h#L1
 #define RUBY_VERSION "2.5.0"
 #define RUBY_RELEASE_DATE "2018-02-21"
-#define RUBY_PATCHLEVEL 25
+#define RUBY_PATCHLEVEL 26
 
 #define RUBY_RELEASE_YEAR 2018
 #define RUBY_RELEASE_MONTH 2
Index: ruby_2_5
===================================================================
--- ruby_2_5	(revision 62506)
+++ ruby_2_5	(revision 62507)

Property changes on: ruby_2_5
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r62115

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

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