From a80ccef9ae519c4c4c8f1dd337a26bd14d244f2a Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Tue, 5 Aug 2014 14:27:56 +0300 Subject: [PATCH] Read the right array in cleanup debug printing This fixes crashes in certain cases. --- convert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert.c b/convert.c index 2d3cb3b..341dd60 100644 --- a/convert.c +++ b/convert.c @@ -2488,7 +2488,7 @@ static void cleanup(void) typedefs[n].struct_decl_idx); } } else if (typedefs[n].enum_decl_idx != (unsigned) -1) { - if (structs[typedefs[n].enum_decl_idx].name[0]) { + if (enums[typedefs[n].enum_decl_idx].name[0]) { dprintf("[%d]: %s (enum %s = %d)\n", n, typedefs[n].name, enums[typedefs[n].enum_decl_idx].name,