summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2025-06-07 22:23:52 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2026-05-05 13:27:43 -0700
commit642798eeca806c999332ed3d02ed57a7852f7f1f (patch)
treefa543bd2f6739e163e109088e495535e95fc1c2e
parent1ce2e79b13733f1f2d2bbc2fa9f2b447f6ddd207 (diff)
Add write barriers on Hash#rehash
-rw-r--r--hash.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 3669f55d50..01d3e796ec 100644
--- a/hash.c
+++ b/hash.c
@@ -1939,6 +1939,9 @@ rb_hash_rehash_i(VALUE key, VALUE value, VALUE arg)
else {
st_insert(RHASH_ST_TABLE(arg), (st_data_t)key, (st_data_t)value);
}
+
+ RB_OBJ_WRITTEN(arg, Qundef, key);
+ RB_OBJ_WRITTEN(arg, Qundef, value);
return ST_CONTINUE;
}