diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-02-19 15:36:41 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-02-19 15:36:41 +0900 |
| commit | 787487b16dce4fbb9059a70b13d31d8be679fe70 (patch) | |
| tree | 312c8e8c1b96d631ea5a828f1d4381367f7a5e46 /src/gc.c | |
| parent | ce0a381406b9d919f8cb6578315b7b70d96adb83 (diff) | |
| download | mruby-787487b16dce4fbb9059a70b13d31d8be679fe70.tar.gz mruby-787487b16dce4fbb9059a70b13d31d8be679fe70.zip | |
Check `MRB_TT_*` before object allocation; ref #5352
Diffstat (limited to 'src/gc.c')
| -rw-r--r-- | src/gc.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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); |
