From 470fc68b069ee6b348a2f6ed8c8f75cb587b9480 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Thu, 16 Aug 2012 11:36:16 +0200 Subject: [PATCH] don't try to access function-local functions outside of functions... --- parser.c | 2 ++ 1 file changed, 2 insertions(+) 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))