diff --git a/include/mruby/value.h b/include/mruby/value.h index 293ef90a7..a73803a14 100644 --- a/include/mruby/value.h +++ b/include/mruby/value.h @@ -107,12 +107,12 @@ static const unsigned int IEEE754_INFINITY_BITS_SINGLE = 0x7F800000; enum mrb_vtype { MRB_TT_FALSE = 0, MRB_TT_TRUE, - MRB_TT_FLOAT, - MRB_TT_INTEGER, MRB_TT_SYMBOL, MRB_TT_UNDEF, - MRB_TT_CPTR, MRB_TT_FREE, + MRB_TT_FLOAT, + MRB_TT_INTEGER, + MRB_TT_CPTR, MRB_TT_OBJECT, MRB_TT_CLASS, MRB_TT_MODULE, diff --git a/src/gc.c b/src/gc.c index 98a2237d5..07ca61e52 100644 --- a/src/gc.c +++ b/src/gc.c @@ -559,6 +559,9 @@ mrb_obj_alloc(mrb_state *mrb, enum mrb_vtype ttype, struct RClass *cls) mrb_raisef(mrb, E_TYPE_ERROR, "allocation failure of %C", cls); } } + if (ttype <= MRB_TT_FREE) { + mrb_raisef(mrb, E_TYPE_ERROR, "allocation failure of %C (type %d)", cls, (int)ttype); + } #ifdef MRB_GC_STRESS mrb_full_gc(mrb);