From 5b6140741479a39ae2deb95a6203e27e29b7ea6b Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 1 Jun 2023 09:13:44 +0900 Subject: [PATCH] class.c (prepare_singleton_class): defer method table allocation --- src/class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/class.c b/src/class.c index e30102e10..28f1d46ce 100644 --- a/src/class.c +++ b/src/class.c @@ -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;