From 29ff037211ba5a7516931d691cb6cc33f77ca6a9 Mon Sep 17 00:00:00 2001 From: usa Date: Fri, 21 Dec 2012 15:37:01 +0000 Subject: merge revision(s) 38493,38539: [Backport #7454] * gc.c (nonspecial_obj_id): VALUE is not compatible with Fixnum on LLP64 platform, such as 64bit Windows. reporeted by Heesob Park at [ruby-core:50255] [Bug #7454], and the fix is suggested by akr. * 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/branches/ruby_1_9_3@38541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- object.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'object.c') diff --git a/object.c b/object.c index 2c0aa7d8e2..e8cb3283ba 100644 --- a/object.c +++ b/object.c @@ -112,7 +112,14 @@ VALUE 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); } -- cgit v1.2.3