ruby-changes:50708
From: nagachika <ko1@a...>
Date: Thu, 22 Mar 2018 00:27:16 +0900 (JST)
Subject: [ruby-changes:50708] nagachika:r62877 (ruby_2_4): merge revision(s) 62107: [Backport #14420]
nagachika 2018-03-22 00:27:09 +0900 (Thu, 22 Mar 2018) New Revision: 62877 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62877 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_4/ Modified files: branches/ruby_2_4/complex.c branches/ruby_2_4/rational.c branches/ruby_2_4/test/ruby/test_complex.rb branches/ruby_2_4/test/ruby/test_rational.rb branches/ruby_2_4/version.h Index: ruby_2_4/version.h =================================================================== --- ruby_2_4/version.h (revision 62876) +++ ruby_2_4/version.h (revision 62877) @@ -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-22" -#define RUBY_PATCHLEVEL 279 +#define RUBY_PATCHLEVEL 280 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 3 Index: ruby_2_4/complex.c =================================================================== --- ruby_2_4/complex.c (revision 62876) +++ ruby_2_4/complex.c (revision 62877) @@ -1233,7 +1233,7 @@ nucomp_hash(VALUE self) https://github.com/ruby/ruby/blob/trunk/ruby_2_4/complex.c#L1233 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_4/test/ruby/test_complex.rb =================================================================== --- ruby_2_4/test/ruby/test_complex.rb (revision 62876) +++ ruby_2_4/test/ruby/test_complex.rb (revision 62877) @@ -48,8 +48,12 @@ class Complex_Test < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/ruby_2_4/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_4/test/ruby/test_rational.rb =================================================================== --- ruby_2_4/test/ruby/test_rational.rb (revision 62876) +++ ruby_2_4/test/ruby/test_rational.rb (revision 62877) @@ -42,7 +42,9 @@ class Rational_Test < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_4/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_4/rational.c =================================================================== --- ruby_2_4/rational.c (revision 62876) +++ ruby_2_4/rational.c (revision 62877) @@ -1710,7 +1710,7 @@ nurat_hash(VALUE self) https://github.com/ruby/ruby/blob/trunk/ruby_2_4/rational.c#L1710 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_4 =================================================================== --- ruby_2_4 (revision 62876) +++ ruby_2_4 (revision 62877) Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r62107 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/