summaryrefslogtreecommitdiffhomepage
path: root/src/state.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2016-06-10 10:04:52 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2016-06-10 10:04:52 +0900
commit8dde647a512e5f3ff08e40edbd7a8b7eeb934071 (patch)
tree322c03738f0f60fd1d82a9b7ae39352de264ed65 /src/state.c
parent6b0299f72b23071342d3ab067db1abbf15253102 (diff)
downloadmruby-8dde647a512e5f3ff08e40edbd7a8b7eeb934071.tar.gz
mruby-8dde647a512e5f3ff08e40edbd7a8b7eeb934071.zip
add temporary workaround for irep memory corruption
need to find out real memory bug that appears in full-debug/mrbtest
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/state.c b/src/state.c
index 898e77336..1259ac3a0 100644
--- a/src/state.c
+++ b/src/state.c
@@ -141,7 +141,7 @@ mrb_irep_free(mrb_state *mrb, mrb_irep *irep)
if (!(irep->flags & MRB_ISEQ_NO_FREE))
mrb_free(mrb, irep->iseq);
- for (i=0; i<irep->plen; i++) {
+ if (irep->pool) for (i=0; i<irep->plen; i++) {
if (mrb_type(irep->pool[i]) == MRB_TT_STRING) {
mrb_gc_free_str(mrb, RSTRING(irep->pool[i]));
mrb_free(mrb, mrb_obj_ptr(irep->pool[i]));