Avoid using mrb_ary_modify from the internal function.

`mrb_ary_modify` calls `mrb_write_barrier`, so can cause the same
problem of the past `push`. It is provided for use-level API.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-07-22 14:23:10 +09:00
parent 5533c29833
commit 097f525817
+1 -1
View File
@@ -943,7 +943,7 @@ mrb_ary_aset(mrb_state *mrb, mrb_value self)
mrb_value v1, v2, v3;
mrb_int i, len;
mrb_ary_modify(mrb, mrb_ary_ptr(self));
ary_modify(mrb, mrb_ary_ptr(self));
if (mrb_get_argc(mrb) == 2) {
mrb_value *vs = mrb_get_argv(mrb);
v1 = vs[0]; v2 = vs[1];