From: Nick Bowler Date: Tue, 18 Jul 2023 02:20:07 +0000 (-0400) Subject: libcdecl: Don't propagate specifier lists more than once. X-Git-Tag: v1.3~114 X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/commitdiff_plain/7faacc8b3fbc810ec92faa0c38af5270e3bd1b4e libcdecl: Don't propagate specifier lists more than once. The very first thing the library does with the parse tree is normalize the top-level specifiers, and then propagate the resulting list across all top-level declarators. So it is completely redundant for the parser itself to propagate the un-normalized specifier list. --- diff --git a/src/parse.y b/src/parse.y index a386c08..b77cfbb 100644 --- a/src/parse.y +++ b/src/parse.y @@ -254,9 +254,7 @@ semi: | T_SEMICOLON declaration: declspecs declarators semi { $$ = $2; - - for (struct cdecl *i = $$; i; i = i->next) - i->specifiers = $1; + $$->specifiers = $1; }; /*