mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add write barrier to protect singleton class from GC; fix #3717
This commit is contained in:
@@ -318,6 +318,7 @@ mrb_obj_clone(mrb_state *mrb, mrb_value self)
|
||||
}
|
||||
p = (struct RObject*)mrb_obj_alloc(mrb, mrb_type(self), mrb_obj_class(mrb, self));
|
||||
p->c = mrb_singleton_class_clone(mrb, self);
|
||||
mrb_field_write_barrier(mrb, (struct RBasic*)p, (struct RBasic*)p->c);
|
||||
clone = mrb_obj_value(p);
|
||||
init_copy(mrb, clone, self);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user