mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Copy iv table with #prepend; fix #5309
In addition, stop eager allocation of `mt` table.
This commit is contained in:
+2
-1
@@ -1497,7 +1497,8 @@ mrb_prepend_module(mrb_state *mrb, struct RClass *c, struct RClass *m)
|
||||
origin->super = c->super;
|
||||
c->super = origin;
|
||||
origin->mt = c->mt;
|
||||
c->mt = mt_new(mrb);
|
||||
c->mt = NULL;
|
||||
origin->iv = c->iv;
|
||||
mrb_field_write_barrier(mrb, (struct RBasic*)c, (struct RBasic*)origin);
|
||||
c->flags |= MRB_FL_CLASS_IS_PREPENDED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user