]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
keep track of the highest parameter count of calls for later for varargs
authorWolfgang Bumiller <blub@speed.at>
Sat, 12 Jan 2013 09:57:44 +0000 (10:57 +0100)
committerWolfgang Bumiller <blub@speed.at>
Sat, 12 Jan 2013 09:58:01 +0000 (10:58 +0100)
parser.c

index e9b368e6b7b56fe6e18eb6e546e39a0a95efc0c3..2e16853217f2110ee8f317257d95779b6c2a3556 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -100,6 +100,9 @@ typedef struct {
 
     /* pragma flags */
     bool noref;
+
+    /* collected information */
+    size_t     max_param_count;
 } parser_t;
 
 static const ast_expression *intrinsic_debug_typestring = (ast_expression*)0x10;
@@ -1403,6 +1406,8 @@ static bool parser_close_call(parser_t *parser, shunt *sy)
             params->exprs = NULL;
             ast_delete(params);
         }
+        if (parser->max_param_count < paramcount)
+            parser->max_param_count = paramcount;
         (void)!ast_call_check_types(call);
     } else {
         parseerror(parser, "invalid function call");