zero initialize singleton_class iv

parent 78be24c8
......@@ -74,6 +74,7 @@ make_metaclass(mrb_state *mrb, struct RClass *c)
}
sc = (struct RClass*)mrb_obj_alloc(mrb, MRB_TT_SCLASS, mrb->class_class);
sc->mt = 0;
sc->iv = 0;
if (!c->super) {
sc->super = mrb->class_class;
}
......@@ -763,9 +764,7 @@ mrb_singleton_class_ptr(mrb_state *mrb, struct RClass *c)
{
struct RClass *sc;
if (c->tt == MRB_TT_SCLASS) {
return c;
}
if (o->c->tt == MRB_TT_SCLASS) return;
sc = (struct RClass*)mrb_obj_alloc(mrb, MRB_TT_SCLASS, mrb->class_class);
sc->mt = 0;
sc->super = c;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment