X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=ast.c;h=238d00a8e9455ec7e3770f8a2b1426887cff1287;hp=7b2da4d872fd578361c50af6ae6e231e4ea2a626;hb=af53c0cb8331a7aa37dbc8200444915155cb6ad3;hpb=87a43777ab37a0c1c4c82997fdfb27c6a4ffa834 diff --git a/ast.c b/ast.c index 7b2da4d..238d00a 100644 --- a/ast.c +++ b/ast.c @@ -1192,7 +1192,6 @@ ast_function* ast_function_new(lex_ctx_t ctx, const char *name, ast_value *vtype if (!vtype) { compile_error(ast_ctx(self), "internal error: ast_function_new condition 0"); goto cleanup; - } else if (vtype->hasvalue || vtype->expression.vtype != TYPE_FUNCTION) { } else if (vtype->hasvalue || vtype->expression.vtype != TYPE_FUNCTION) { compile_error(ast_ctx(self), "internal error: ast_function_new condition %i %i type=%i (probably 2 bodies?)", (int)!vtype, @@ -1222,6 +1221,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 +1245,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);