Merge pull request #6159 from dearblue/debug/irep-free

Allow to detect use-after-free after `mrb_irep_free()` for debugging
This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-02-04 16:26:03 +09:00
committed by GitHub
+3
View File
@@ -161,6 +161,9 @@ mrb_irep_free(mrb_state *mrb, mrb_irep *irep)
}
mrb_free(mrb, (void*)irep->lv);
mrb_debug_info_free(mrb, irep->debug_info);
#ifdef MRB_DEBUG
memset(irep, -1, sizeof(*irep));
#endif
mrb_free(mrb, irep);
}