1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

struct.c: force hash values fixable

* struct.c (rb_struct_hash): force hash values fixable on LLP64
  environment.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2019-04-08 05:06:43 +00:00
parent b29f55c5ac
commit 7a4c39c5f2
2 changed files with 2 additions and 1 deletions

View file

@ -1202,7 +1202,7 @@ rb_struct_hash(VALUE s)
h = rb_hash_uint(h, NUM2LONG(n));
}
h = rb_hash_end(h);
return INT2FIX(h);
return ST2FIX(h);
}
static VALUE

View file

@ -275,6 +275,7 @@ module TestStruct
klass = @Struct.new(:a)
o = klass.new(1)
assert_kind_of(Integer, o.hash)
assert_kind_of(String, o.hash.to_s)
end
def test_eql