From 7faacc8b3fbc810ec92faa0c38af5270e3bd1b4e Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Mon, 17 Jul 2023 22:20:07 -0400 Subject: [PATCH] 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. --- src/parse.y | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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; }; /* -- 2.43.2