From: Wolfgang (Blub) Bumiller Date: Thu, 16 Aug 2012 09:36:16 +0000 (+0200) Subject: don't try to access function-local functions outside of functions... X-Git-Tag: 0.1-rc1~270 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=470fc68b069ee6b348a2f6ed8c8f75cb587b9480;p=xonotic%2Fgmqcc.git don't try to access function-local functions outside of functions... --- diff --git a/parser.c b/parser.c index e56e6e6..a0bb6f9 100644 --- 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))