mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
make_metaclass should skip MRB_TT_ICLASS; close #1369
This commit is contained in:
+3
-4
@@ -69,15 +69,14 @@ prepare_singleton_class(mrb_state *mrb, struct RBasic *o)
|
||||
sc->iv = 0;
|
||||
if (o->tt == MRB_TT_CLASS) {
|
||||
c = (struct RClass*)o;
|
||||
if (!c->super) {
|
||||
sc->super = mrb->class_class;
|
||||
}
|
||||
else {
|
||||
if (c->super) {
|
||||
sc->super = c->super->c;
|
||||
}
|
||||
}
|
||||
else if (o->tt == MRB_TT_SCLASS) {
|
||||
c = (struct RClass*)o;
|
||||
while (c->super->tt == MRB_TT_ICLASS)
|
||||
c = c->super;
|
||||
make_metaclass(mrb, c->super);
|
||||
sc->super = c->super->c;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user