need to call write barrier on hash keys; ref #2375

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-06-13 00:41:49 +09:00
parent fe95f44013
commit 2ed7089546
+2 -1
View File
@@ -216,11 +216,12 @@ mrb_hash_set(mrb_state *mrb, mrb_value hash, mrb_value key, mrb_value val)
if (r != 0) {
/* expand */
int ai = mrb_gc_arena_save(mrb);
kh_key(h, k) = KEY(key);
key = kh_key(h, k) = KEY(key);
mrb_gc_arena_restore(mrb, ai);
kh_value(h, k).n = kh_size(h)-1;
}
mrb_field_write_barrier_value(mrb, (struct RBasic*)RHASH(hash), key);
mrb_field_write_barrier_value(mrb, (struct RBasic*)RHASH(hash), val);
return;
}