From e31f9b0aff2329544ce0798cccf34d381e34aa8a Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 30 Apr 2019 13:04:57 +0000 Subject: merge revision(s) 67467: [Backport #15756] range.c: force hash values fixable * range.c (method_hash): force hash values fixable on LLP64 environment. [ruby-core:92191] [Bug #15756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- proc.c | 2 +- test/ruby/test_method.rb | 1 + version.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/proc.c b/proc.c index b14d1444e5..303fc047c2 100644 --- a/proc.c +++ b/proc.c @@ -1550,7 +1550,7 @@ method_hash(VALUE method) hash = rb_hash_method_entry(hash, m->me); hash = rb_hash_end(hash); - return INT2FIX(hash); + return ST2FIX(hash); } /* diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index fe0171dd57..cb68b2eca9 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -197,6 +197,7 @@ class TestMethod < Test::Unit::TestCase def o.foo; end assert_kind_of(Integer, o.method(:foo).hash) assert_equal(Array.instance_method(:map).hash, Array.instance_method(:collect).hash) + assert_kind_of(String, o.method(:foo).hash.to_s) end def test_owner diff --git a/version.h b/version.h index 043653f71b..6b71429bc1 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.5.6" #define RUBY_RELEASE_DATE "2019-04-30" -#define RUBY_PATCHLEVEL 163 +#define RUBY_PATCHLEVEL 164 #define RUBY_RELEASE_YEAR 2019 #define RUBY_RELEASE_MONTH 4 -- cgit v1.2.3