Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 29ff037211ba5a7516931d691cb6cc33f77ca6a9 1 parent 2b2ccf4
@unak unak authored
Showing with 33 additions and 5 deletions.
  1. +13 −0 ChangeLog
  2. +9 −1 gc.c
  3. +8 −1 object.c
  4. +3 −3 version.h
View
13 ChangeLog
@@ -1,3 +1,16 @@
+Sat Dec 22 00:33:28 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]
+
+Sat Dec 22 00:33:28 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * 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.
+
Fri Dec 21 16:03:54 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* test/ruby/test_argf.rb (TestArgf#test_chars): since marshal data is
View
10 gc.c
@@ -99,6 +99,14 @@ ruby_gc_params_t initial_params = {
#define nomem_error GET_VM()->special_exceptions[ruby_error_nomemory]
+#if SIZEOF_LONG == SIZEOF_VOIDP
+# define nonspecial_obj_id(obj) (VALUE)((SIGNED_VALUE)(obj)|FIXNUM_FLAG)
+#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
+# define nonspecial_obj_id(obj) LL2NUM((SIGNED_VALUE)(obj) / 2)
+#else
+# error not supported
+#endif
+
int ruby_gc_debug_indent = 0;
/* for GC profile */
@@ -3283,7 +3291,7 @@ rb_obj_id(VALUE obj)
if (SPECIAL_CONST_P(obj)) {
return LONG2NUM((SIGNED_VALUE)obj);
}
- return (VALUE)((SIGNED_VALUE)obj|FIXNUM_FLAG);
+ return nonspecial_obj_id(obj);
}
static int
View
9 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);
}
View
6 version.h
@@ -1,10 +1,10 @@
#define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 357
+#define RUBY_PATCHLEVEL 358
-#define RUBY_RELEASE_DATE "2012-12-21"
+#define RUBY_RELEASE_DATE "2012-12-22"
#define RUBY_RELEASE_YEAR 2012
#define RUBY_RELEASE_MONTH 12
-#define RUBY_RELEASE_DAY 21
+#define RUBY_RELEASE_DAY 22
#include "ruby/version.h"
Please sign in to comment.
Something went wrong with that request. Please try again.