mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
enumerator.c: force hash values fixable
* enumerator.c (arith_seq_hash): force hash values fixable on LLP64 environment. [ruby-core:92190] [Bug #15755] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
012faccf04
commit
06eece87c6
2 changed files with 2 additions and 1 deletions
|
@ -3345,7 +3345,7 @@ arith_seq_hash(VALUE self)
|
||||||
hash = rb_hash_uint(hash, NUM2LONG(v));
|
hash = rb_hash_uint(hash, NUM2LONG(v));
|
||||||
hash = rb_hash_end(hash);
|
hash = rb_hash_end(hash);
|
||||||
|
|
||||||
return LONG2FIX(hash);
|
return ST2FIX(hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define NUM_GE(x, y) RTEST(rb_num_coerce_relop((x), (y), idGE))
|
#define NUM_GE(x, y) RTEST(rb_num_coerce_relop((x), (y), idGE))
|
||||||
|
|
|
@ -127,6 +127,7 @@ class TestArithmeticSequence < Test::Unit::TestCase
|
||||||
assert_equal(seq.hash, seq.hash)
|
assert_equal(seq.hash, seq.hash)
|
||||||
assert_equal(seq.hash, 1.step.hash)
|
assert_equal(seq.hash, 1.step.hash)
|
||||||
assert_equal(seq.hash, 1.step(nil).hash)
|
assert_equal(seq.hash, 1.step(nil).hash)
|
||||||
|
assert_kind_of(String, seq.hash.to_s)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_first
|
def test_first
|
||||||
|
|
Loading…
Add table
Reference in a new issue