From 0af62801f46727e27f84472ddf4033f7527ee0e2 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Sun, 25 Nov 2012 23:35:31 +0100 Subject: [PATCH] Don't add redeclared globals a second time --- parser.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/parser.c b/parser.c index 338993a..1268d03 100644 --- a/parser.c +++ b/parser.c @@ -3739,6 +3739,15 @@ static bool parse_variable(parser_t *parser, ast_block *localblock, bool nofield retval = false; goto cleanup; } + proto = (ast_value*)old; + if (!ast_istype(old, ast_value)) { + parseerror(parser, "internal error: not an ast_value"); + retval = false; + proto = NULL; + goto cleanup; + } + ast_delete(var); + var = proto; } } if (opts_standard == COMPILER_QCC && -- 2.39.2