ruby-changes:5936
From: nobu <ko1@a...>
Date: Fri, 20 Jun 2008 01:40:43 +0900 (JST)
Subject: [ruby-changes:5936] Ruby:r17444 (ruby_1_8_6, ruby_1_8_5): * array.c (rb_ary_equal, rb_ary_eql, rb_ary_hash, rb_ary_cmp):
nobu 2008-06-20 01:40:23 +0900 (Fri, 20 Jun 2008) New Revision: 17444 Modified files: branches/ruby_1_8_5/ChangeLog branches/ruby_1_8_5/array.c branches/ruby_1_8_5/version.h branches/ruby_1_8_6/ChangeLog branches/ruby_1_8_6/array.c branches/ruby_1_8_6/version.h Log: * array.c (rb_ary_equal, rb_ary_eql, rb_ary_hash, rb_ary_cmp): Make Array#eql?, #hash, #== and #<=> use rb_protect_inspect() and handle recursive data properly. [ruby-dev:35181] http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/ChangeLog?r1=17444&r2=17443&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/version.h?r1=17444&r2=17443&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/version.h?r1=17444&r2=17443&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/array.c?r1=17444&r2=17443&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/array.c?r1=17444&r2=17443&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/ChangeLog?r1=17444&r2=17443&diff_format=u Index: ruby_1_8_5/array.c =================================================================== --- ruby_1_8_5/array.c (revision 17443) +++ ruby_1_8_5/array.c (revision 17444) @@ -2460,7 +2460,6 @@ { long i; - if (rb_inspecting_p(ary1)) return Qfalse; for (i=0; i<RARRAY(ary1)->len; i++) { if (!rb_equal(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i))) return Qfalse; @@ -2494,6 +2493,7 @@ return rb_equal(ary2, ary1); } if (RARRAY(ary1)->len != RARRAY(ary2)->len) return Qfalse; + if (rb_inspecting_p(ary1)) return Qfalse; return rb_protect_inspect(recursive_equal, ary1, ary2); } @@ -2503,7 +2503,6 @@ { long i; - if (rb_inspecting_p(ary1)) return Qfalse; for (i=0; i<RARRAY(ary1)->len; i++) { if (!rb_eql(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i))) return Qfalse; @@ -2526,6 +2525,7 @@ if (ary1 == ary2) return Qtrue; if (TYPE(ary2) != T_ARRAY) return Qfalse; if (RARRAY(ary1)->len != RARRAY(ary2)->len) return Qfalse; + if (rb_inspecting_p(ary1)) return Qfalse; return rb_protect_inspect(recursive_eql, ary1, ary2); } @@ -2538,9 +2538,6 @@ long i, h; VALUE n; - if (rb_inspecting_p(ary)) { - return LONG2FIX(0); - } h = RARRAY(ary)->len; for (i=0; i<RARRAY(ary)->len; i++) { h = (h << 1) | (h<0 ? 1 : 0); @@ -2562,6 +2559,9 @@ rb_ary_hash(ary) VALUE ary; { + if (rb_inspecting_p(ary)) { + return LONG2FIX(0); + } return rb_protect_inspect(recursive_hash, ary, 0); } @@ -2599,7 +2599,6 @@ { long i, len; - if (rb_inspecting_p(ary1)) return Qfalse; len = RARRAY(ary1)->len; if (len > RARRAY(ary2)->len) { len = RARRAY(ary2)->len; @@ -2642,6 +2641,7 @@ ary2 = to_ary(ary2); if (ary1 == ary2) return INT2FIX(0); + if (rb_inspecting_p(ary1)) return INT2FIX(0); v = rb_protect_inspect(recursive_cmp, ary1, ary2); if (v != Qundef) return v; len = RARRAY(ary1)->len - RARRAY(ary2)->len; Index: ruby_1_8_5/ChangeLog =================================================================== --- ruby_1_8_5/ChangeLog (revision 17443) +++ ruby_1_8_5/ChangeLog (revision 17444) @@ -1,7 +1,7 @@ -Thu Jun 19 23:57:54 2008 Nobuyoshi Nakada <nobu@r...> +Fri Jun 20 01:40:21 2008 Nobuyoshi Nakada <nobu@r...> * array.c (rb_ary_equal, rb_ary_eql, rb_ary_hash, rb_ary_cmp): - Make Array#eql?, #hash, #== and #<=> use rb_exec_recursive() and + Make Array#eql?, #hash, #== and #<=> use rb_protect_inspect() and handle recursive data properly. [ruby-dev:35181] Wed Jun 18 15:17:30 2008 Nobuyoshi Nakada <nobu@r...> Index: ruby_1_8_5/version.h =================================================================== --- ruby_1_8_5/version.h (revision 17443) +++ ruby_1_8_5/version.h (revision 17444) @@ -1,15 +1,15 @@ #define RUBY_VERSION "1.8.5" -#define RUBY_RELEASE_DATE "2008-06-19" +#define RUBY_RELEASE_DATE "2008-06-20" #define RUBY_VERSION_CODE 185 -#define RUBY_RELEASE_CODE 20080619 -#define RUBY_PATCHLEVEL 227 +#define RUBY_RELEASE_CODE 20080620 +#define RUBY_PATCHLEVEL 228 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 #define RUBY_VERSION_TEENY 5 #define RUBY_RELEASE_YEAR 2008 #define RUBY_RELEASE_MONTH 6 -#define RUBY_RELEASE_DAY 19 +#define RUBY_RELEASE_DAY 20 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; Index: ruby_1_8_6/array.c =================================================================== --- ruby_1_8_6/array.c (revision 17443) +++ ruby_1_8_6/array.c (revision 17444) @@ -2468,7 +2468,6 @@ { long i; - if (rb_inspecting_p(ary1)) return Qfalse; for (i=0; i<RARRAY(ary1)->len; i++) { if (!rb_equal(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i))) return Qfalse; @@ -2502,6 +2501,7 @@ return rb_equal(ary2, ary1); } if (RARRAY(ary1)->len != RARRAY(ary2)->len) return Qfalse; + if (rb_inspecting_p(ary1)) return Qfalse; return rb_protect_inspect(recursive_equal, ary1, ary2); } @@ -2511,7 +2511,6 @@ { long i; - if (rb_inspecting_p(ary1)) return Qfalse; for (i=0; i<RARRAY(ary1)->len; i++) { if (!rb_eql(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i))) return Qfalse; @@ -2534,6 +2533,7 @@ if (ary1 == ary2) return Qtrue; if (TYPE(ary2) != T_ARRAY) return Qfalse; if (RARRAY(ary1)->len != RARRAY(ary2)->len) return Qfalse; + if (rb_inspecting_p(ary1)) return Qfalse; return rb_protect_inspect(recursive_eql, ary1, ary2); } @@ -2546,9 +2546,6 @@ long i, h; VALUE n; - if (rb_inspecting_p(ary)) { - return LONG2FIX(0); - } h = RARRAY(ary)->len; for (i=0; i<RARRAY(ary)->len; i++) { h = (h << 1) | (h<0 ? 1 : 0); @@ -2570,6 +2567,9 @@ rb_ary_hash(ary) VALUE ary; { + if (rb_inspecting_p(ary)) { + return LONG2FIX(0); + } return rb_protect_inspect(recursive_hash, ary, 0); } @@ -2607,7 +2607,6 @@ { long i, len; - if (rb_inspecting_p(ary1)) return Qfalse; len = RARRAY(ary1)->len; if (len > RARRAY(ary2)->len) { len = RARRAY(ary2)->len; @@ -2650,6 +2649,7 @@ ary2 = to_ary(ary2); if (ary1 == ary2) return INT2FIX(0); + if (rb_inspecting_p(ary1)) return INT2FIX(0); v = rb_protect_inspect(recursive_cmp, ary1, ary2); if (v != Qundef) return v; len = RARRAY(ary1)->len - RARRAY(ary2)->len; Index: ruby_1_8_6/ChangeLog =================================================================== --- ruby_1_8_6/ChangeLog (revision 17443) +++ ruby_1_8_6/ChangeLog (revision 17444) @@ -1,7 +1,7 @@ -Thu Jun 19 23:57:54 2008 Nobuyoshi Nakada <nobu@r...> +Fri Jun 20 01:40:21 2008 Nobuyoshi Nakada <nobu@r...> * array.c (rb_ary_equal, rb_ary_eql, rb_ary_hash, rb_ary_cmp): - Make Array#eql?, #hash, #== and #<=> use rb_exec_recursive() and + Make Array#eql?, #hash, #== and #<=> use rb_protect_inspect() and handle recursive data properly. [ruby-dev:35181] Wed Jun 18 15:20:21 2008 Nobuyoshi Nakada <nobu@r...> Index: ruby_1_8_6/version.h =================================================================== --- ruby_1_8_6/version.h (revision 17443) +++ ruby_1_8_6/version.h (revision 17444) @@ -1,15 +1,15 @@ #define RUBY_VERSION "1.8.6" -#define RUBY_RELEASE_DATE "2008-06-19" +#define RUBY_RELEASE_DATE "2008-06-20" #define RUBY_VERSION_CODE 186 -#define RUBY_RELEASE_CODE 20080619 -#define RUBY_PATCHLEVEL 226 +#define RUBY_RELEASE_CODE 20080620 +#define RUBY_PATCHLEVEL 227 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 #define RUBY_VERSION_TEENY 6 #define RUBY_RELEASE_YEAR 2008 #define RUBY_RELEASE_MONTH 6 -#define RUBY_RELEASE_DAY 19 +#define RUBY_RELEASE_DAY 20 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/