From a851bcd631e9a8953f29b4f63ad0354ee775e02e Mon Sep 17 00:00:00 2001 From: Masamitsu MURASE Date: Tue, 21 Aug 2012 02:01:26 +0900 Subject: Refer to irep_capa as well as irep_len when irep is marked by GC. Initialize mrb->irep array with 0 when realloc is called. --- src/gc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/gc.c') diff --git a/src/gc.c b/src/gc.c index 9286f361b..9a45049d2 100644 --- a/src/gc.c +++ b/src/gc.c @@ -587,8 +587,10 @@ root_scan_phase(mrb_state *mrb) mrb_gc_mark(mrb, (struct RBasic*)ci->target_class); } /* mark irep pool */ - for (i=0; iirep_len; i++) { - if (mrb->irep) { + if (mrb->irep) { + size_t len = mrb->irep_len; + if (len > mrb->irep_capa) len = mrb->irep_capa; + for (i=0; iirep[i]; if (!irep) continue; for (j=0; jplen; j++) { -- cgit v1.2.3