]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
fix: use thinkfunc not nextthink, nextthink is set later
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 19 Aug 2012 17:25:37 +0000 (19:25 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 19 Aug 2012 17:25:37 +0000 (19:25 +0200)
parser.c

index 10bcd3747ce86e24a92cd2b57ce2c7a501637b7e..294fca13c8a39408c4ed9430643771b5a94378ba 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -2204,7 +2204,7 @@ nextvar:
                     ast_expression *functype = fld_think->expression.next;
 
                     thinkfunc = ast_value_new(parser_ctx(parser), parser_tokval(parser), functype->expression.vtype);
-                    if (!thinkfunc || !ast_type_adopt(nextthink, functype)) {
+                    if (!thinkfunc || !ast_type_adopt(thinkfunc, functype)) {
                         ast_unref(framenum);
                         parseerror(parser, "failed to create implicit prototype for `%s`", parser_tokval(parser));
                         return false;
@@ -2217,13 +2217,13 @@ nextvar:
 
                     varent.var = (ast_expression*)thinkfunc;
                     varent.name = util_strdup(thinkfunc->name);
-                    if (nextthink->expression.vtype == TYPE_FUNCTION)
+                    if (thinkfunc->expression.vtype == TYPE_FUNCTION)
                     {
                         ast_function *func;
 
                         func = ast_function_new(parser_ctx(parser), thinkfunc->name, thinkfunc);
                         if (!func) {
-                            ast_delete(nextthink);
+                            ast_delete(thinkfunc);
                             ast_unref(framenum);
                             parseerror(parser, "failed to create function for implicit prototype for `%s`",
                                        thinkfunc->name);