summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--complex.c2
-rw-r--r--rational.c2
-rw-r--r--test/ruby/test_complex.rb8
-rw-r--r--test/ruby/test_rational.rb4
-rw-r--r--version.h2
5 files changed, 12 insertions, 6 deletions
diff --git a/complex.c b/complex.c
index cee9770f67..e06faa813b 100644
--- a/complex.c
+++ b/complex.c
@@ -1250,7 +1250,7 @@ nucomp_hash(VALUE self)
n = rb_hash(dat->imag);
h[1] = NUM2LONG(n);
v = rb_memhash(h, sizeof(h));
- return LONG2FIX(v);
+ return ST2FIX(v);
}
/* :nodoc: */
diff --git a/rational.c b/rational.c
index 0617fd7327..d1453aa9f7 100644
--- a/rational.c
+++ b/rational.c
@@ -1781,7 +1781,7 @@ nurat_hash(VALUE self)
n = rb_hash(dat->den);
h[1] = NUM2LONG(n);
v = rb_memhash(h, sizeof(h));
- return LONG2FIX(v);
+ return ST2FIX(v);
}
static VALUE
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb
index ded316841a..316e3e21ff 100644
--- a/test/ruby/test_complex.rb
+++ b/test/ruby/test_complex.rb
@@ -48,8 +48,12 @@ class Complex_Test < Test::Unit::TestCase
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
diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb
index d94ded3fe3..43658e5454 100644
--- a/test/ruby/test_rational.rb
+++ b/test/ruby/test_rational.rb
@@ -42,7 +42,9 @@ class Rational_Test < Test::Unit::TestCase
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
diff --git a/version.h b/version.h
index 84f97fda6f..3eb2a6ebdd 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#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