make_metaclass should skip MRB_TT_ICLASS; close #1369

This commit is contained in:
Yukihiro "Matz" Matsumoto
2013-07-13 10:41:09 +09:00
parent b0d7902a2f
commit cd05c669ca
+3 -4
View File
@@ -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;
}