Skip to content

Commit 7e978b1

Browse files
committed
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 58a60b2 commit 7e978b1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Sun Dec 29 07:27:51 2013 Benoit Daloze <eregontp@gmail.com>
2+
3+
* compar.c (cmp_eq_recursive): Fix the return value, the value for
4+
failed #<=> should be nil. It was raising a NoMethodError for
5+
the test case TestComparable#test_no_cmp (undefined method `>'
6+
for false:FalseClass). Yet one more reason for #7688.
7+
18
Sat Dec 28 22:21:59 2013 Benoit Daloze <eregontp@gmail.com>
29

310
* object.c (Kernel#<=>) surround Comparable operators with <code> tags.

compar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ rb_invcmp(VALUE x, VALUE y)
5454
static VALUE
5555
cmp_eq_recursive(VALUE arg1, VALUE arg2, int recursive)
5656
{
57-
if (recursive) return Qfalse;
57+
if (recursive) return Qnil;
5858
return rb_funcallv(arg1, cmp, 1, &arg2);
5959
}
6060

0 commit comments

Comments
 (0)