Skip to content

Commit 06eece8

Browse files
committed
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
1 parent 012facc commit 06eece8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

enumerator.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3345,7 +3345,7 @@ arith_seq_hash(VALUE self)
33453345
hash = rb_hash_uint(hash, NUM2LONG(v));
33463346
hash = rb_hash_end(hash);
33473347

3348-
return LONG2FIX(hash);
3348+
return ST2FIX(hash);
33493349
}
33503350

33513351
#define NUM_GE(x, y) RTEST(rb_num_coerce_relop((x), (y), idGE))

test/ruby/test_arithmetic_sequence.rb

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ def test_hash
127127
assert_equal(seq.hash, seq.hash)
128128
assert_equal(seq.hash, 1.step.hash)
129129
assert_equal(seq.hash, 1.step(nil).hash)
130+
assert_kind_of(String, seq.hash.to_s)
130131
end
131132

132133
def test_first

0 commit comments

Comments
 (0)