diff options
author | Kenichi Kamiya <kachick1@gmail.com> | 2021-03-22 14:10:52 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-22 14:10:52 +0900 |
commit | 7d3fdfb27dac456827b004d9e66a44b15f8cd762 (patch) | |
tree | 6875ffdbe8b19c41a94c2915dade052bcbf5011a /hash.c | |
parent | db0ad48309edae28a65e3d18e9b3a15753eda777 (diff) |
Hash#transform_values! ensures receiver modifiable in block [Bug #17736]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4302
Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -3303,6 +3303,7 @@ transform_values_foreach_replace(st_data_t *key, st_data_t *value, st_data_t arg { VALUE new_value = rb_yield((VALUE)*value); VALUE hash = (VALUE)argp; + rb_hash_modify(hash); RB_OBJ_WRITE(hash, value, new_value); return ST_CONTINUE; } |