Skip to content

Commit

Permalink
merge revision(s) 62115: [Backport #14421]
Browse files Browse the repository at this point in the history
	proc: fix super_method segfault after bind

	* proc.c: handle undefined iclass
	  [ruby-core:85231] [Bug #14421]

	From: Eric Wong <e@80x24.org>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@62507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nurse committed Feb 21, 2018
1 parent 18b6b67 commit aa58701
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions proc.c
Expand Up @@ -2720,6 +2720,7 @@ method_super_method(VALUE method)

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;
Expand Down
5 changes: 5 additions & 0 deletions test/ruby/test_method.rb
Expand Up @@ -926,6 +926,11 @@ def test_super_method_with_prepended_module
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
Expand Down
2 changes: 1 addition & 1 deletion version.h
@@ -1,6 +1,6 @@
#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
Expand Down

0 comments on commit aa58701

Please sign in to comment.