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

ruby-changes:32374

From: eregon <ko1@a...>
Date: Sun, 29 Dec 2013 07:28:45 +0900 (JST)
Subject: [ruby-changes:32374] eregon:r44453 (trunk): * compar.c (cmp_eq_recursive): Fix the return value, the value for

eregon	2013-12-29 07:28:39 +0900 (Sun, 29 Dec 2013)

  New Revision: 44453

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

  Log:
    * compar.c (cmp_eq_recursive): Fix the return value, the value for
      failed #<=> should be nil. It was raising a NoMethodError for
      the test case TestComparable#test_no_cmp (undefined method `>'
      for false:FalseClass). Yet one more reason for #7688.

  Modified files:
    trunk/ChangeLog
    trunk/compar.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 44452)
+++ ChangeLog	(revision 44453)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Dec 29 07:27:51 2013  Benoit Daloze  <eregontp@g...>
+
+	* compar.c (cmp_eq_recursive): Fix the return value, the value for
+	  failed #<=> should be nil. It was raising a NoMethodError for
+	  the test case TestComparable#test_no_cmp (undefined method `>'
+	  for false:FalseClass). Yet one more reason for #7688.
+
 Sat Dec 28 22:21:59 2013  Benoit Daloze  <eregontp@g...>
 
 	* object.c (Kernel#<=>) surround Comparable operators with <code> tags.
Index: compar.c
===================================================================
--- compar.c	(revision 44452)
+++ compar.c	(revision 44453)
@@ -54,7 +54,7 @@ rb_invcmp(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/compar.c#L54
 static VALUE
 cmp_eq_recursive(VALUE arg1, VALUE arg2, int recursive)
 {
-    if (recursive) return Qfalse;
+    if (recursive) return Qnil;
     return rb_funcallv(arg1, cmp, 1, &arg2);
 }
 

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

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