summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--range.c2
-rw-r--r--test/ruby/test_range.rb1
2 files changed, 2 insertions, 1 deletions
diff --git a/range.c b/range.c
index e5c6fbcf9db..4180a663aa5 100644
--- a/range.c
+++ b/range.c
@@ -230,7 +230,7 @@ range_hash(VALUE range)
hash = rb_hash_uint(hash, EXCL(range) << 24);
hash = rb_hash_end(hash);
- return LONG2FIX(hash);
+ return ST2FIX(hash);
}
static void
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb
index b704f8e1826..b1008d041f3 100644
--- a/test/ruby/test_range.rb
+++ b/test/ruby/test_range.rb
@@ -203,6 +203,7 @@ class TestRange < Test::Unit::TestCase
assert_not_equal((0..1).hash, (0...1).hash)
assert_equal((0..nil).hash, (0..nil).hash)
assert_not_equal((0..nil).hash, (0...nil).hash)
+ assert_kind_of(String, (0..1).hash.to_s)
end
def test_step