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:
parent
b29f55c5ac
commit
7a4c39c5f2
2 changed files with 2 additions and 1 deletions
2
struct.c
2
struct.c
|
@ -1202,7 +1202,7 @@ rb_struct_hash(VALUE s)
|
||||||
h = rb_hash_uint(h, NUM2LONG(n));
|
h = rb_hash_uint(h, NUM2LONG(n));
|
||||||
}
|
}
|
||||||
h = rb_hash_end(h);
|
h = rb_hash_end(h);
|
||||||
return INT2FIX(h);
|
return ST2FIX(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
|
|
@ -275,6 +275,7 @@ module TestStruct
|
||||||
klass = @Struct.new(:a)
|
klass = @Struct.new(:a)
|
||||||
o = klass.new(1)
|
o = klass.new(1)
|
||||||
assert_kind_of(Integer, o.hash)
|
assert_kind_of(Integer, o.hash)
|
||||||
|
assert_kind_of(String, o.hash.to_s)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_eql
|
def test_eql
|
||||||
|
|
Loading…
Add table
Reference in a new issue