ruby-changes:26488
From: usa <ko1@a...>
Date: Sat, 22 Dec 2012 00:30:58 +0900 (JST)
Subject: [ruby-changes:26488] usa:r38539 (trunk): * object.c (rb_obj_hash): shouldn't assume object_id can be long.
usa 2012-12-22 00:30:44 +0900 (Sat, 22 Dec 2012) New Revision: 38539 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38539 Log: * 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] Modified files: trunk/ChangeLog trunk/object.c Index: ChangeLog =================================================================== --- ChangeLog (revision 38538) +++ ChangeLog (revision 38539) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Dec 22 00:28:46 2012 NAKAMURA Usaku <usa@r...> + + * 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@c...> * ext/fiddle/lib/fiddle/struct.rb (Fiddle::CStructEntity#set_ctypes): Index: object.c =================================================================== --- object.c (revision 38538) +++ object.c (revision 38539) @@ -125,7 +125,14 @@ VALUE https://github.com/ruby/ruby/blob/trunk/object.c#L125 rb_obj_hash(VALUE 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); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/