mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Check MRB_TT_* before object allocation; ref #5352
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user