]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
don't try to access function-local functions outside of functions...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 16 Aug 2012 09:36:16 +0000 (11:36 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 16 Aug 2012 09:36:16 +0000 (11:36 +0200)
parser.c

index e56e6e6f17f02be1bbae65377ae64d412b881e30..a0bb6f9f8680c4b4028120c8ef140b9fc240a47a 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -226,6 +226,8 @@ ast_expression* parser_find_local(parser_t *parser, const char *name, size_t upt
         if (!strcmp(parser->locals[i].name, name))
             return parser->locals[i].var;
     }
+    if (!parser->function)
+        return NULL;
     fun = parser->function->vtype;
     for (i = 0; i < fun->expression.params_count; ++i) {
         if (!strcmp(fun->expression.params[i]->name, name))