]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
mark vectors as used when their members are used
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 30 Nov 2012 13:30:25 +0000 (14:30 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 30 Nov 2012 13:30:25 +0000 (14:30 +0100)
parser.c

index dab8b2483a2ae803940c401b92edef9522265188..a9cc2e6ca871392672ce149dc7d648b0b33b5b92 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1412,8 +1412,14 @@ static ast_expression* parse_expression_leave(parser_t *parser, bool stopatcomma
                 parseerror(parser, "unexpected ident: %s", parser_tokval(parser));
                 goto onerr;
             }
-            if (ast_istype(var, ast_value))
+            if (ast_istype(var, ast_value)) {
                 ((ast_value*)var)->uses++;
+            }
+            else if (ast_istype(var, ast_member)) {
+                ast_member *mem = (ast_member*)var;
+                if (ast_istype(mem->owner, ast_value))
+                    ((ast_value*)(mem->owner))->uses++;
+            }
             vec_push(sy.out, syexp(parser_ctx(parser), var));
             DEBUGSHUNTDO(con_out("push %s\n", parser_tokval(parser)));
         }