diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gc.c | 2 | ||||
-rw-r--r-- | test/ruby/test_hash.rb | 2 |
3 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Thu Nov 5 20:49:47 2009 NARUSE, Yui <[email protected]> + + * gc.c (rb_obj_id): a Fixnum which is beyond signed long + was converted to a Bignum in calculating its hash. + [ruby-dev:39637] + Thu Nov 5 12:06:35 2009 NARUSE, Yui <[email protected]> * parse.y (args): use splat_array. @@ -2142,7 +2142,7 @@ rb_obj_id(obj) return (SYM2ID(obj) * sizeof(RVALUE) + (4 << 2)) | FIXNUM_FLAG; } if (SPECIAL_CONST_P(obj)) { - return LONG2NUM((long)obj); + return LONG2FIX((long)obj); } return (VALUE)((long)obj|FIXNUM_FLAG); } diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index 4131a6bdd3..f2ff95464d 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -637,5 +637,7 @@ class TestHash < Test::Unit::TestCase def test_hash_hash assert_equal({0=>2,11=>1}.hash, {11=>1,0=>2}.hash) + assert_equal({:a=>2**29}.hash, {:a=>2**29}.hash) + assert_equal({:a=>2**61}.hash, {:a=>2**61}.hash) end end |