mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Need to insert write barriers in struct updates; fix #3547
This commit is contained in:
@@ -449,6 +449,7 @@ mrb_struct_aset_sym(mrb_state *mrb, mrb_value s, mrb_sym id, mrb_value val)
|
||||
for (i=0; i<len; i++) {
|
||||
if (mrb_symbol(ptr_members[i]) == id) {
|
||||
ptr[i] = val;
|
||||
mrb_write_barrier(mrb, (struct RBasic*)mrb_ptr(s));
|
||||
return val;
|
||||
}
|
||||
}
|
||||
@@ -511,6 +512,7 @@ mrb_struct_aset(mrb_state *mrb, mrb_value s)
|
||||
"offset %S too large for struct(size:%S)",
|
||||
mrb_fixnum_value(i), mrb_fixnum_value(RSTRUCT_LEN(s)));
|
||||
}
|
||||
mrb_write_barrier(mrb, (struct RBasic*)mrb_ptr(s));
|
||||
return RSTRUCT_PTR(s)[i] = val;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user