From 6aa091e5aadafa11d9f10d9fa7d821cf5e5e379d Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 29 Aug 2018 12:37:07 +0900 Subject: Simplified `#ifdef` nesting in `codedump.c`; fix #4089 `printf()` and related functions should not be called when `MRB_DISABLE_STDIO` is defined. --- src/codedump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/codedump.c b/src/codedump.c index 80802778f..454b16b36 100644 --- a/src/codedump.c +++ b/src/codedump.c @@ -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); printf("\n"); } -#endif static void print_header(mrb_irep *irep, ptrdiff_t i) @@ -68,7 +67,6 @@ print_header(mrb_irep *irep, ptrdiff_t i) static void codedump(mrb_state *mrb, mrb_irep *irep) { -#ifndef MRB_DISABLE_STDIO int ai; mrb_code *pc, *pcend; mrb_code ins; @@ -526,7 +524,6 @@ codedump(mrb_state *mrb, mrb_irep *irep) mrb_gc_arena_restore(mrb, ai); } printf("\n"); -#endif } static void @@ -539,9 +536,12 @@ codedump_recur(mrb_state *mrb, mrb_irep *irep) codedump_recur(mrb, irep->reps[i]); } } +#endif void mrb_codedump_all(mrb_state *mrb, struct RProc *proc) { +#ifndef MRB_DISABLE_STDIO codedump_recur(mrb, proc->body.irep); +#endif } -- cgit v1.2.3