Simplified `#ifdef` nesting in `codedump.c`; fix #4089

`printf()` and related functions should not be called when
`MRB_DISABLE_STDIO` is defined.
parent bc88fc6e
...@@ -45,7 +45,6 @@ print_lv_ab(mrb_state *mrb, mrb_irep *irep, uint16_t a, uint16_t b) ...@@ -45,7 +45,6 @@ print_lv_ab(mrb_state *mrb, mrb_irep *irep, uint16_t a, uint16_t b)
if (b > 0) print_r(mrb, irep, b); if (b > 0) print_r(mrb, irep, b);
printf("\n"); printf("\n");
} }
#endif
static void static void
print_header(mrb_irep *irep, ptrdiff_t i) print_header(mrb_irep *irep, ptrdiff_t i)
...@@ -68,7 +67,6 @@ print_header(mrb_irep *irep, ptrdiff_t i) ...@@ -68,7 +67,6 @@ print_header(mrb_irep *irep, ptrdiff_t i)
static void static void
codedump(mrb_state *mrb, mrb_irep *irep) codedump(mrb_state *mrb, mrb_irep *irep)
{ {
#ifndef MRB_DISABLE_STDIO
int ai; int ai;
mrb_code *pc, *pcend; mrb_code *pc, *pcend;
mrb_code ins; mrb_code ins;
...@@ -526,7 +524,6 @@ codedump(mrb_state *mrb, mrb_irep *irep) ...@@ -526,7 +524,6 @@ codedump(mrb_state *mrb, mrb_irep *irep)
mrb_gc_arena_restore(mrb, ai); mrb_gc_arena_restore(mrb, ai);
} }
printf("\n"); printf("\n");
#endif
} }
static void static void
...@@ -539,9 +536,12 @@ codedump_recur(mrb_state *mrb, mrb_irep *irep) ...@@ -539,9 +536,12 @@ codedump_recur(mrb_state *mrb, mrb_irep *irep)
codedump_recur(mrb, irep->reps[i]); codedump_recur(mrb, irep->reps[i]);
} }
} }
#endif
void void
mrb_codedump_all(mrb_state *mrb, struct RProc *proc) mrb_codedump_all(mrb_state *mrb, struct RProc *proc)
{ {
#ifndef MRB_DISABLE_STDIO
codedump_recur(mrb, proc->body.irep); codedump_recur(mrb, proc->body.irep);
#endif
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment