mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
gc.c (obj_free): check if irep is NULL before mrb_irep_decref(); #6161
This commit is contained in:
@@ -827,7 +827,9 @@ obj_free(mrb_state *mrb, struct RBasic *obj, int end)
|
||||
{
|
||||
struct RBacktrace *bt = (struct RBacktrace*)obj;
|
||||
for (size_t i = 0; i < bt->len; i++) {
|
||||
mrb_irep_decref(mrb, (mrb_irep*)bt->locations[i].irep);
|
||||
const mrb_irep *irep = bt->locations[i].irep;
|
||||
if (irep == NULL) continue;
|
||||
mrb_irep_decref(mrb, (mrb_irep*)irep);
|
||||
}
|
||||
mrb_free(mrb, bt->locations);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user