From: Dale Weiler Date: Tue, 5 Feb 2013 03:28:20 +0000 (+0000) Subject: Better handling of multiple body functions. X-Git-Tag: before-library~154 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=31ce4c2afa0ffbbcbd61cb593b7be54d1de48c00;p=xonotic%2Fgmqcc.git Better handling of multiple body functions. --- diff --git a/parser.c b/parser.c index aa536c5..3375acc 100644 --- a/parser.c +++ b/parser.c @@ -3981,6 +3981,12 @@ static bool parse_function_body(parser_t *parser, ast_value *var) } } + if (var->hasvalue) { + parseerror(parser, "function `%s` declared with multiple bodies", var->name); + ast_block_delete(block); + goto enderr; + } + func = ast_function_new(ast_ctx(var), var->name, var); if (!func) { parseerror(parser, "failed to allocate function for `%s`", var->name);