fixed parsing of function parameters
This commit is contained in:
10
tcc.c
10
tcc.c
@ -6853,7 +6853,8 @@ static void post_type(CType *type, AttributeDef *ad)
|
||||
l = 0;
|
||||
first = NULL;
|
||||
plast = &first;
|
||||
while (tok != ')') {
|
||||
if (tok != ')') {
|
||||
for(;;) {
|
||||
/* read param name and compute offset */
|
||||
if (l != FUNC_OLD) {
|
||||
if (!parse_btype(&pt, &ad1)) {
|
||||
@ -6873,6 +6874,8 @@ static void post_type(CType *type, AttributeDef *ad)
|
||||
} else {
|
||||
old_proto:
|
||||
n = tok;
|
||||
if (n < TOK_UIDENT)
|
||||
expect("identifier");
|
||||
pt.t = VT_INT;
|
||||
next();
|
||||
}
|
||||
@ -6880,8 +6883,9 @@ static void post_type(CType *type, AttributeDef *ad)
|
||||
s = sym_push(n | SYM_FIELD, &pt, 0, 0);
|
||||
*plast = s;
|
||||
plast = &s->next;
|
||||
if (tok == ',') {
|
||||
next();
|
||||
if (tok == ')')
|
||||
break;
|
||||
skip(',');
|
||||
if (l == FUNC_NEW && tok == TOK_DOTS) {
|
||||
l = FUNC_ELLIPSIS;
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user