summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--hash.c13
2 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 10ab61c555..f132b5af2e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Dec 19 15:36:02 2014 Simon Genier <simon.genier@shopify.com>
+
+ * hash.c (hash_equal): prefer true than the result of implicit
+ conversion from int returned by rb_eql() to VALUE. [Fix GH-789]
+
Thu Dec 18 17:45:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (rb_cv_binary_elf): get rid of -e option of cat
diff --git a/hash.c b/hash.c
index a0c1ced09b..1b9b5a2e49 100644
--- a/hash.c
+++ b/hash.c
@@ -1944,10 +1944,17 @@ hash_equal(VALUE hash1, VALUE hash2, int eql)
if (!rb_respond_to(hash2, idTo_hash)) {
return Qfalse;
}
- if (eql)
- return rb_eql(hash2, hash1);
- else
+ if (eql) {
+ if (rb_eql(hash2, hash1)) {
+ return Qtrue;
+ }
+ else {
+ return Qfalse;
+ }
+ }
+ else {
return rb_equal(hash2, hash1);
+ }
}
if (RHASH_SIZE(hash1) != RHASH_SIZE(hash2))
return Qfalse;