Skip to content

Commit

Permalink
Fix param list parser for void functions
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenthuberdeau committed Feb 18, 2025
1 parent e37a3ba commit 9df1643
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pnut.c
Original file line number Diff line number Diff line change
Expand Up @@ -2783,7 +2783,7 @@ int parse_param_list() {
while (tok != ')' && tok != EOF) {
if (is_type_starter(tok)) {
decl = parse_declarator(true, parse_declaration_specifiers());
if (get_op(decl) == VOID_KW) {
if (get_op(get_child_(DECL, decl, 1)) == VOID_KW) {
if (tok != ')' || result != 0) parse_error("void must be the only parameter", tok);
break;
}
Expand Down

0 comments on commit 9df1643

Please sign in to comment.