]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
need to use ast_unref rather than ast_delete on the parsed array-size otherwise we...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 11 Nov 2012 11:13:34 +0000 (12:13 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 11 Nov 2012 11:13:34 +0000 (12:13 +0100)
parser.c

index f1466a1b3a4abfce274150812f3c0b1249e1b0c3..2cbf57636250757e94d96b202480f7718f82f216 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -2284,7 +2284,7 @@ static ast_value *parse_arraysize(parser_t *parser, ast_value *var)
 
     if (!cexp || !ast_istype(cexp, ast_value)) {
         if (cexp)
-            ast_delete(cexp);
+            ast_unref(cexp);
         ast_delete(var);
         parseerror(parser, "expected array-size as constant positive integer");
         return NULL;
@@ -2300,12 +2300,12 @@ static ast_value *parse_arraysize(parser_t *parser, ast_value *var)
     else if (cval->expression.vtype == TYPE_FLOAT)
         tmp->expression.count = cval->constval.vfloat;
     else {
-        ast_delete(cexp);
+        ast_unref(cexp);
         ast_delete(var);
         parseerror(parser, "array-size must be a positive integer constant");
         return NULL;
     }
-    ast_delete(cexp);
+    ast_unref(cexp);
 
     if (parser->tok != ']') {
         ast_delete(var);