summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-10 07:31:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-10 07:31:06 +0000
commitf3f43cdbee1703afd92f9f6dbb471642bcede9f5 (patch)
tree4f97958bcbb0220be3dd81af4fff045127369f76 /hash.c
parent6942afef5f8eb829b85b05bbea59c9eb9214739c (diff)
* array.c (rb_ary_push_m, rb_ary_unshift_m, rb_ary_aset),
(rb_ary_insert, rb_ary_replace, rb_ary_concat), (rb_ary_uniq_bang, rb_ary_flatten_bang): check if frozen after wrong number of arguments but before TypeError. [ruby-core:28140] * hash.c (rb_hash_replace): ditto. * string.c (rb_str_replace): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 7a6bfe8134..d49d0ea71d 100644
--- a/hash.c
+++ b/hash.c
@@ -1073,6 +1073,7 @@ replace_i(VALUE key, VALUE val, VALUE hash)
static VALUE
rb_hash_replace(VALUE hash, VALUE hash2)
{
+ rb_hash_modify_check(hash);
hash2 = to_hash(hash2);
if (hash == hash2) return hash;
rb_hash_clear(hash);