[前][次][番号順一覧][スレッド一覧]

ruby-changes:26490

From: usa <ko1@a...>
Date: Sat, 22 Dec 2012 00:37:13 +0900 (JST)
Subject: [ruby-changes:26490] usa:r38541 (ruby_1_9_3): merge revision(s) 38493,38539: [Backport #7454]

usa	2012-12-22 00:37:01 +0900 (Sat, 22 Dec 2012)

  New Revision: 38541

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38541

  Log:
    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]

  Modified directories:
    branches/ruby_1_9_3/
  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/gc.c
    branches/ruby_1_9_3/object.c
    branches/ruby_1_9_3/version.h

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 38540)
+++ ruby_1_9_3/ChangeLog	(revision 38541)
@@ -1,3 +1,16 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1
+Sat Dec 22 00:33:28 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]
+
+Sat Dec 22 00:33:28 2012  NAKAMURA Usaku  <usa@r...>
+
+	* 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@r...>
 
 	* test/ruby/test_argf.rb (TestArgf#test_chars): since marshal data is
Index: ruby_1_9_3/object.c
===================================================================
--- ruby_1_9_3/object.c	(revision 38540)
+++ ruby_1_9_3/object.c	(revision 38541)
@@ -112,7 +112,14 @@ VALUE https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/object.c#L112
 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);
 }
 
Index: ruby_1_9_3/gc.c
===================================================================
--- ruby_1_9_3/gc.c	(revision 38540)
+++ ruby_1_9_3/gc.c	(revision 38541)
@@ -99,6 +99,14 @@ ruby_gc_params_t initial_params = { https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/gc.c#L99
 
 #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) https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/gc.c#L3291
     if (SPECIAL_CONST_P(obj)) {
         return LONG2NUM((SIGNED_VALUE)obj);
     }
-    return (VALUE)((SIGNED_VALUE)obj|FIXNUM_FLAG);
+    return nonspecial_obj_id(obj);
 }
 
 static int
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 38540)
+++ ruby_1_9_3/version.h	(revision 38541)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1
 #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"
 

Property changes on: ruby_1_9_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r38493,38539


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]