]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Don't allow arrays and other unsupported parameter types to be used in parameter...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 11 Nov 2012 13:08:02 +0000 (14:08 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 11 Nov 2012 13:08:02 +0000 (14:08 +0100)
parser.c

index 1b2b691f67f595309cd31ef7a9a0308ca6fa06e2..fbc09679408e49826959037bac69deafb9ac05af 100644 (file)
--- 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(&params, param))
+            if (!paramlist_t_p_add(&params, 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;
+            }
         }
     }