mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
class.c (mrb_prepend_module): c should not be MRB_TT_ICLASS
This commit is contained in:
+1
-9
@@ -1519,15 +1519,7 @@ mrb_prepend_module(mrb_state *mrb, struct RClass *c, struct RClass *m)
|
||||
|
||||
mrb_check_frozen(mrb, c);
|
||||
if (!(c->flags & MRB_FL_CLASS_IS_PREPENDED)) {
|
||||
struct RClass *c0;
|
||||
|
||||
if (c->tt == MRB_TT_ICLASS) {
|
||||
c0 = c->c;
|
||||
}
|
||||
else {
|
||||
c0 = c;
|
||||
}
|
||||
origin = MRB_OBJ_ALLOC(mrb, MRB_TT_ICLASS, c0);
|
||||
origin = MRB_OBJ_ALLOC(mrb, MRB_TT_ICLASS, c);
|
||||
origin->flags |= MRB_FL_CLASS_IS_ORIGIN | MRB_FL_CLASS_IS_INHERITED;
|
||||
origin->super = c->super;
|
||||
c->super = origin;
|
||||
|
||||
Reference in New Issue
Block a user