From: Wolfgang (Blub) Bumiller Date: Sun, 11 Nov 2012 13:08:02 +0000 (+0100) Subject: Don't allow arrays and other unsupported parameter types to be used in parameter... X-Git-Tag: 0.1~19^2~36 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=86e42ad123de0f2065172e2c92202e4226044ecc;p=xonotic%2Fgmqcc.git Don't allow arrays and other unsupported parameter types to be used in parameter lists --- diff --git a/parser.c b/parser.c index 1b2b691..fbc0967 100644 --- a/parser.c +++ b/parser.c @@ -2239,8 +2239,16 @@ static ast_value *parse_parameter_list(parser_t *parser, ast_value *var) param = parse_typename(parser, NULL); if (!param) goto on_error; - if (!paramlist_t_p_add(¶ms, param)) + if (!paramlist_t_p_add(¶ms, param)) { + ast_delete(param); goto on_error; + } + if (param->expression.vtype >= TYPE_VARIANT) { + char typename[1024]; + ast_type_to_string((ast_expression*)param, typename, sizeof(typename)); + parseerror(parser, "type not supported as part of a parameter list: %s", typename); + goto on_error; + } } }