From 5f41f78784ede72a5f9c75fa2f3daaa35ada8bad Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 6 Nov 2014 22:56:37 -0800 Subject: [PATCH] dump_value__() recursive case even more sane --- dump.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/dump.c b/dump.c index fceaabb24a..34270b962a 100644 --- a/dump.c +++ b/dump.c @@ -282,30 +282,26 @@ dump_value__(int level, bool match1) int x = get_u32(); printf ("\"%s\" with %d variables:\n", base, x); - if (match_u32(0)) + for (int i = 0; i < x; i++) { - for (int i = 0; i < x; i++) + int y = get_u32(); + if (!y) + y = 1; + else + match_u32_assert(0); + for (int j = 0; j <= level; j++) + printf (" "); + printf("variable %d has %d values:\n", i, y); + for (int j = 0; j < y; j++) { - dump_value (level+1, match1); + match_byte(0); + match_byte(0); + match_byte(0); + match_byte(0); + dump_value__ (level+1, false); putchar('\n'); } } - else - { - for (int i = 0; i < x; i++) - { - int y = get_u32(); - match_u32_assert(0); - for (int j = 0; j <= level; j++) - printf (" "); - printf("variable %d has %d values:\n", i, y); - for (int j = 0; j < y; j++) - { - dump_value (level+1, false); - putchar('\n'); - } - } - } } } -- 2.30.2