mirror of https://github.com/rui314/chibicc
func_params token skip refactor
In func_params, the branch for handling "..." calls skip(tok, ")"), which seemed suspicious. After careful inspection, I realize the return value is not being used, so there is no bug. Nevertheless, it may still be worth it to move the skip to the bottom of the function.
This commit is contained in:
parent
90d1f7f199
commit
0881f3e4b1
3
parse.c
3
parse.c
|
@ -598,7 +598,6 @@ static Type *func_params(Token **rest, Token *tok, Type *ty) {
|
|||
if (equal(tok, "...")) {
|
||||
is_variadic = true;
|
||||
tok = tok->next;
|
||||
skip(tok, ")");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -628,7 +627,7 @@ static Type *func_params(Token **rest, Token *tok, Type *ty) {
|
|||
ty = func_type(ty);
|
||||
ty->params = head.next;
|
||||
ty->is_variadic = is_variadic;
|
||||
*rest = tok->next;
|
||||
*rest = skip(tok, ")");
|
||||
return ty;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue