class.c (prepare_singleton_class): defer method table allocation

This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-06-01 09:13:44 +09:00
parent 0d8545e01b
commit 5b61407414
+1 -1
View File
@@ -370,7 +370,7 @@ prepare_singleton_class(mrb_state *mrb, struct RBasic *o)
if (o->c->tt == MRB_TT_SCLASS) return;
sc = MRB_OBJ_ALLOC(mrb, MRB_TT_SCLASS, mrb->class_class);
sc->flags |= MRB_FL_CLASS_IS_INHERITED;
sc->mt = mt_new(mrb);
sc->mt = NULL;
sc->iv = NULL;
if (o->tt == MRB_TT_CLASS) {
c = (struct RClass*)o;