]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Don't add redeclared globals a second time
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 25 Nov 2012 22:35:31 +0000 (23:35 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 25 Nov 2012 22:35:31 +0000 (23:35 +0100)
parser.c

index 338993ac4fa773a4d283fd389ed233784b4739b0..1268d03a5839245addbdf23df30eff0efbd2086b 100644 (file)
--- 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 &&