]> git.draconx.ca Git - cdecl99.git/commitdiff
libcdecl: Don't propagate specifier lists more than once.
authorNick Bowler <nbowler@draconx.ca>
Tue, 18 Jul 2023 02:20:07 +0000 (22:20 -0400)
committerNick Bowler <nbowler@draconx.ca>
Tue, 18 Jul 2023 02:20:07 +0000 (22:20 -0400)
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

index a386c086b9718abc413f515e5183008036ce3776..b77cfbb1f4f1e454c16ef77ea3131e96f87c78d5 100644 (file)
@@ -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;
 };
 
 /*