diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-02-03 16:08:27 -0800 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-02-03 16:08:27 -0800 |
| commit | e887059cbf7e84e87525d9d330a0ce50da79f5e3 (patch) | |
| tree | 72dac23d4880cc30da6ddd972374321a772854c6 | |
| parent | 0f68b90a9156d3251b22c89423ae3f710980d2c9 (diff) | |
| parent | aeb8e2eaacab5a8dc8d71dbd36883cf100c92ccd (diff) | |
| download | mruby-e887059cbf7e84e87525d9d330a0ce50da79f5e3.tar.gz mruby-e887059cbf7e84e87525d9d330a0ce50da79f5e3.zip | |
Merge pull request #816 from masamitsu-murase/modify_potential_error_of_hash
Fix potential bug about Hash.
| -rw-r--r-- | src/hash.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/hash.c b/src/hash.c index 26d9b78b0..b7ac59ada 100644 --- a/src/hash.c +++ b/src/hash.c @@ -821,8 +821,9 @@ mrb_hash_empty_p(mrb_state *mrb, mrb_value self) if (h) { if (kh_size(h) == 0) return mrb_true_value(); + return mrb_false_value(); } - return mrb_false_value(); + return mrb_true_value(); } /* 15.2.13.4.11 */ @@ -1123,7 +1124,7 @@ hash_equal(mrb_state *mrb, mrb_value hash1, mrb_value hash2, int eql) } h1 = RHASH_TBL(hash1); h2 = RHASH_TBL(hash2); - if (!h2) { + if (!h1) { if (!h2) return mrb_true_value(); return mrb_false_value(); } |
