]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ast.c
static variables now don't get re-initialized in functions; cannot be initialized...
[xonotic/gmqcc.git] / ast.c
diff --git a/ast.c b/ast.c
index 7b2da4d872fd578361c50af6ae6e231e4ea2a626..1644e243cc122626ca4ea9ba88f07be9c7490d92 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1222,6 +1222,9 @@ ast_function* ast_function_new(lex_ctx_t ctx, const char *name, ast_value *vtype
     self->fixedparams      = NULL;
     self->return_value     = NULL;
 
+    self->static_names     = NULL;
+    self->static_count     = 0;
+
     return self;
 
 cleanup:
@@ -1243,6 +1246,9 @@ void ast_function_delete(ast_function *self)
          */
         ast_unref(self->vtype);
     }
+    for (i = 0; i < vec_size(self->static_names); ++i)
+        mem_d(self->static_names[i]);
+    vec_free(self->static_names);
     for (i = 0; i < vec_size(self->blocks); ++i)
         ast_delete(self->blocks[i]);
     vec_free(self->blocks);