mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* object.c (rb_obj_hash): shouldn't assume object_id can be long.
based on a patch by Heesob Park at [ruby-core:51060]. cf. [Backport #7454] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8346f7b2ad
commit
e31b67700b
2 changed files with 14 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Sat Dec 22 00:28:46 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* object.c (rb_obj_hash): shouldn't assume object_id can be long.
|
||||||
|
based on a patch by Heesob Park at [ruby-core:51060].
|
||||||
|
cf. [Backport #7454]
|
||||||
|
|
||||||
Fri Dec 21 23:15:25 2012 Kouhei Sutou <kou@cozmixng.org>
|
Fri Dec 21 23:15:25 2012 Kouhei Sutou <kou@cozmixng.org>
|
||||||
|
|
||||||
* ext/fiddle/lib/fiddle/struct.rb (Fiddle::CStructEntity#set_ctypes):
|
* ext/fiddle/lib/fiddle/struct.rb (Fiddle::CStructEntity#set_ctypes):
|
||||||
|
|
9
object.c
9
object.c
|
@ -125,7 +125,14 @@ VALUE
|
||||||
rb_obj_hash(VALUE obj)
|
rb_obj_hash(VALUE obj)
|
||||||
{
|
{
|
||||||
VALUE oid = rb_obj_id(obj);
|
VALUE oid = rb_obj_id(obj);
|
||||||
st_index_t h = rb_hash_end(rb_hash_start(NUM2LONG(oid)));
|
#if SIZEOF_LONG == SIZEOF_VOIDP
|
||||||
|
st_index_t index = NUM2LONG(oid);
|
||||||
|
#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
|
||||||
|
st_index_t index = NUM2LL(oid);
|
||||||
|
#else
|
||||||
|
# error not supported
|
||||||
|
#endif
|
||||||
|
st_index_t h = rb_hash_end(rb_hash_start(index));
|
||||||
return LONG2FIX(h);
|
return LONG2FIX(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue