diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-21 02:25:27 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-21 02:25:27 +0000 |
commit | 9cacc53d4a45d5af962d5c6fb9a5406b518641da (patch) | |
tree | 07c4b84a7b9fb8201af9bace810bb683177e798c /enum.c | |
parent | 5eec76bc7bcae341908fdbbbc39a3d91c4a7f67a (diff) |
Fix Enumerable#uniq with non single yield arguments
* enum.c (uniq_func, uniq_iter): need packed value as the unique
key. [ruby-core:81734] [Bug #13669] [Fix GH-1658]
Author: Kenichi Kamiya <[email protected]>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r-- | enum.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -3855,6 +3855,7 @@ enum_sum(int argc, VALUE* argv, VALUE obj) static VALUE uniq_func(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash)) { + ENUM_WANT_SVALUE(); rb_hash_add_new_element(hash, i, i); return Qnil; } @@ -3862,6 +3863,7 @@ uniq_func(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash)) static VALUE uniq_iter(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash)) { + ENUM_WANT_SVALUE(); rb_hash_add_new_element(hash, rb_yield_values2(argc, argv), i); return Qnil; } |