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

ruby-changes:26547

From: usa <ko1@a...>
Date: Tue, 25 Dec 2012 20:44:53 +0900 (JST)
Subject: [ruby-changes:26547] usa:r38598 (ruby_1_9_3): merge revision(s) 38595,38596: [Backport #7607]

usa	2012-12-25 20:42:55 +0900 (Tue, 25 Dec 2012)

  New Revision: 38598

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

  Log:
    merge revision(s) 38595,38596: [Backport #7607]
    
    * bignum.c, include/ruby/intern.h (rb_big_eql): exported.
    
    * thread.c (recursive_check): object_id maybe a Bignum, not Fixnum on
      LLP64.  see also r38493 and r38548.
      reported by Heesob Park at [ruby-core:51083] [Bug #7607], and patched
      by shirosaki at [ruby-core:51095]

  Modified directories:
    branches/ruby_1_9_3/
  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/bignum.c
    branches/ruby_1_9_3/include/ruby/intern.h
    branches/ruby_1_9_3/thread.c
    branches/ruby_1_9_3/version.h

Index: ruby_1_9_3/include/ruby/intern.h
===================================================================
--- ruby_1_9_3/include/ruby/intern.h	(revision 38597)
+++ ruby_1_9_3/include/ruby/intern.h	(revision 38598)
@@ -122,6 +122,7 @@ VALUE rb_dbl2big(double); https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/include/ruby/intern.h#L122
 double rb_big2dbl(VALUE);
 VALUE rb_big_cmp(VALUE, VALUE);
 VALUE rb_big_eq(VALUE, VALUE);
+VALUE rb_big_eql(VALUE, VALUE);
 VALUE rb_big_plus(VALUE, VALUE);
 VALUE rb_big_minus(VALUE, VALUE);
 VALUE rb_big_mul(VALUE, VALUE);
Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 38597)
+++ ruby_1_9_3/ChangeLog	(revision 38598)
@@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1
+Tue Dec 25 20:40:47 2012  NAKAMURA Usaku  <usa@r...>
+
+	* bignum.c, include/ruby/intern.h (rb_big_eql): exported.
+
+	* thread.c (recursive_check): object_id maybe a Bignum, not Fixnum on
+	  LLP64.  see also r38493 and r38548.
+	  reported by Heesob Park at [ruby-core:51083] [Bug #7607], and patched
+	  by shirosaki at [ruby-core:51095]
+
 Tue Dec 25 09:54:31 2012  Hiroshi Shirosaki  <h.shirosaki@g...>
 
 	* gc.c (obj_id_to_ref): add a macro to treat Bignum object id.
Index: ruby_1_9_3/thread.c
===================================================================
--- ruby_1_9_3/thread.c	(revision 38597)
+++ ruby_1_9_3/thread.c	(revision 38598)
@@ -3855,17 +3855,24 @@ recursive_list_access(void) https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/thread.c#L3855
 static VALUE
 recursive_check(VALUE list, VALUE obj_id, VALUE paired_obj_id)
 {
+#if SIZEOF_LONG == SIZEOF_VOIDP
+  #define OBJ_ID_EQL(obj_id, other) ((obj_id) == (other))
+#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
+  #define OBJ_ID_EQL(obj_id, other) (RB_TYPE_P((obj_id), T_BIGNUM) ? \
+    rb_big_eql((obj_id), (other)) : ((obj_id) == (other)))
+#endif
+
     VALUE pair_list = rb_hash_lookup2(list, obj_id, Qundef);
     if (pair_list == Qundef)
 	return Qfalse;
     if (paired_obj_id) {
 	if (TYPE(pair_list) != T_HASH) {
-	if (pair_list != paired_obj_id)
-	    return Qfalse;
+	    if (!OBJ_ID_EQL(paired_obj_id, pair_list))
+		return Qfalse;
 	}
 	else {
-	if (NIL_P(rb_hash_lookup(pair_list, paired_obj_id)))
-	    return Qfalse;
+	    if (NIL_P(rb_hash_lookup(pair_list, paired_obj_id)))
+		return Qfalse;
 	}
     }
     return Qtrue;
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 38597)
+++ ruby_1_9_3/version.h	(revision 38598)
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1
 #define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 359
+#define RUBY_PATCHLEVEL 360
 
 #define RUBY_RELEASE_DATE "2012-12-25"
 #define RUBY_RELEASE_YEAR 2012
Index: ruby_1_9_3/bignum.c
===================================================================
--- ruby_1_9_3/bignum.c	(revision 38597)
+++ ruby_1_9_3/bignum.c	(revision 38598)
@@ -1628,7 +1628,7 @@ rb_big_eq(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/bignum.c#L1628
  *     68719476736.eql?(68719476736.0)   #=> false
  */
 
-static VALUE
+VALUE
 rb_big_eql(VALUE x, VALUE y)
 {
     if (TYPE(y) != T_BIGNUM) return Qfalse;

Property changes on: ruby_1_9_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r38595-38596


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

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