From 35f9aef7295ed20c58aa812e106be921fa7e8acd Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 11 Sep 2013 11:25:44 +0200 Subject: [PATCH 1/1] fix: declaring locals with the name of a parameter now treats the parameter as the local's prototype to avoid it being double-freed later --- parser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parser.c b/parser.c index d65eafe..e3b4d9a 100644 --- a/parser.c +++ b/parser.c @@ -5221,6 +5221,7 @@ static bool parse_variable(parser_t *parser, ast_block *localblock, bool nofield retval = false; goto cleanup; } + /* doing this here as the above is just for a single scope */ old = parser_find_local(parser, var->name, 0, &isparam); if (old && isparam) { if (parsewarning(parser, WARN_LOCAL_SHADOWS, @@ -5234,7 +5235,7 @@ static bool parse_variable(parser_t *parser, ast_block *localblock, bool nofield if (OPTS_OPTION_U32(OPTION_STANDARD) != COMPILER_GMQCC) { ast_delete(var); if (ast_istype(old, ast_value)) - var = (ast_value*)old; + var = proto = (ast_value*)old; else { var = NULL; goto skipvar; -- 2.39.2