From 2f9db8972ee0c8cd5f491f47d79a283c8d72c7aa Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Sat, 12 Jan 2013 10:57:44 +0100 Subject: [PATCH] keep track of the highest parameter count of calls for later for varargs --- parser.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/parser.c b/parser.c index e9b368e..2e16853 100644 --- 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"); -- 2.39.2