ruby-changes:50422
From: naruse <ko1@a...>
Date: Fri, 23 Feb 2018 06:41:51 +0900 (JST)
Subject: [ruby-changes:50422] naruse:r62538 (ruby_2_5): merge revision(s) 62107: [Backport #14420]
naruse 2018-02-23 06:41:46 +0900 (Fri, 23 Feb 2018) New Revision: 62538 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62538 Log: merge revision(s) 62107: [Backport #14420] force fixable * complex.c (nucomp_hash): force hash values fixable. [ruby-core:85224] [Bug #14420] * rational.c (nurat_hash): ditto. Modified directories: branches/ruby_2_5/ Modified files: branches/ruby_2_5/complex.c branches/ruby_2_5/rational.c branches/ruby_2_5/test/ruby/test_complex.rb branches/ruby_2_5/test/ruby/test_rational.rb branches/ruby_2_5/version.h Index: ruby_2_5/version.h =================================================================== --- ruby_2_5/version.h (revision 62537) +++ ruby_2_5/version.h (revision 62538) @@ -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-23" -#define RUBY_PATCHLEVEL 31 +#define RUBY_PATCHLEVEL 32 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 2 Index: ruby_2_5/test/ruby/test_complex.rb =================================================================== --- ruby_2_5/test/ruby/test_complex.rb (revision 62537) +++ ruby_2_5/test/ruby/test_complex.rb (revision 62538) @@ -48,8 +48,12 @@ class Complex_Test < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/ruby_2_5/test/ruby/test_complex.rb#L48 end def test_hash - assert_kind_of(Integer, Complex(1,2).hash) - assert_kind_of(Integer, Complex(1.0,2.0).hash) + h = Complex(1,2).hash + assert_kind_of(Integer, h) + assert_nothing_raised {h.to_s} + h = Complex(1.0,2.0).hash + assert_kind_of(Integer, h) + assert_nothing_raised {h.to_s} h = {} h[Complex(0)] = 0 Index: ruby_2_5/test/ruby/test_rational.rb =================================================================== --- ruby_2_5/test/ruby/test_rational.rb (revision 62537) +++ ruby_2_5/test/ruby/test_rational.rb (revision 62538) @@ -42,7 +42,9 @@ class Rational_Test < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_5/test/ruby/test_rational.rb#L42 end def test_hash - assert_kind_of(Integer, Rational(1,2).hash) + h = Rational(1,2).hash + assert_kind_of(Integer, h) + assert_nothing_raised {h.to_s} h = {} h[Rational(0)] = 0 Index: ruby_2_5/rational.c =================================================================== --- ruby_2_5/rational.c (revision 62537) +++ ruby_2_5/rational.c (revision 62538) @@ -1781,7 +1781,7 @@ nurat_hash(VALUE self) https://github.com/ruby/ruby/blob/trunk/ruby_2_5/rational.c#L1781 n = rb_hash(dat->den); h[1] = NUM2LONG(n); v = rb_memhash(h, sizeof(h)); - return LONG2FIX(v); + return ST2FIX(v); } static VALUE Index: ruby_2_5/complex.c =================================================================== --- ruby_2_5/complex.c (revision 62537) +++ ruby_2_5/complex.c (revision 62538) @@ -1250,7 +1250,7 @@ nucomp_hash(VALUE self) https://github.com/ruby/ruby/blob/trunk/ruby_2_5/complex.c#L1250 n = rb_hash(dat->imag); h[1] = NUM2LONG(n); v = rb_memhash(h, sizeof(h)); - return LONG2FIX(v); + return ST2FIX(v); } /* :nodoc: */ Index: ruby_2_5 =================================================================== --- ruby_2_5 (revision 62537) +++ ruby_2_5 (revision 62538) Property changes on: ruby_2_5 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r62107 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/