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:
Luke Zhu 2024-10-27 01:24:43 +00:00
parent 90d1f7f199
commit 0881f3e4b1
1 changed files with 1 additions and 2 deletions

View File

@ -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;
}