ruby-changes:50699
From: nagachika <ko1@a...>
Date: Wed, 21 Mar 2018 01:21:17 +0900 (JST)
Subject: [ruby-changes:50699] nagachika:r62866 (ruby_2_4): merge revision(s) 62115: [Backport #14421]
nagachika 2018-03-21 01:21:06 +0900 (Wed, 21 Mar 2018) New Revision: 62866 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62866 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_4/ Modified files: branches/ruby_2_4/proc.c branches/ruby_2_4/test/ruby/test_method.rb branches/ruby_2_4/version.h Index: ruby_2_4/version.h =================================================================== --- ruby_2_4/version.h (revision 62865) +++ ruby_2_4/version.h (revision 62866) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #define RUBY_VERSION "2.4.4" #define RUBY_RELEASE_DATE "2018-03-21" -#define RUBY_PATCHLEVEL 274 +#define RUBY_PATCHLEVEL 275 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 3 Index: ruby_2_4/test/ruby/test_method.rb =================================================================== --- ruby_2_4/test/ruby/test_method.rb (revision 62865) +++ ruby_2_4/test/ruby/test_method.rb (revision 62866) @@ -923,6 +923,11 @@ class TestMethod < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/ruby/test_method.rb#L923 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_4/proc.c =================================================================== --- ruby_2_4/proc.c (revision 62865) +++ ruby_2_4/proc.c (revision 62866) @@ -2712,6 +2712,7 @@ method_super_method(VALUE method) https://github.com/ruby/ruby/blob/trunk/ruby_2_4/proc.c#L2712 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_4 =================================================================== --- ruby_2_4 (revision 62865) +++ ruby_2_4 (revision 62866) Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r62115 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/