summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
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);