From 6be56ef1fbd21b7791e484006ee5b6e342310812 Mon Sep 17 00:00:00 2001 From: Yukihiro Matz Matsumoto Date: Tue, 5 Mar 2013 00:32:38 +0900 Subject: save/restore arena index for each codedump iteration --- src/codegen.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/codegen.c') diff --git a/src/codegen.c b/src/codegen.c index d2640904a..74b6e01f4 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -2375,13 +2375,14 @@ codedump(mrb_state *mrb, int n) { #ifdef ENABLE_STDIO mrb_irep *irep = mrb->irep[n]; - int i; + int i, ai; mrb_code c; if (!irep) return; printf("irep %d nregs=%d nlocals=%d pools=%d syms=%d\n", n, irep->nregs, irep->nlocals, irep->plen, irep->slen); for (i=0; iilen; i++) { + ai = mrb_gc_arena_save(mrb); printf("%03d ", i); c = irep->iseq[i]; switch (GET_OPCODE(c)) { @@ -2682,6 +2683,7 @@ codedump(mrb_state *mrb, int n) GETARG_A(c), GETARG_B(c), GETARG_C(c)); break; } + mrb_gc_arena_restore(mrb, ai); } printf("\n"); #endif -- cgit v1.2.3