[hackers] [scc] Don't install tags that are already installed || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Fri, 24 Jul 2015 19:02:32 +0200 (CEST)

commit 51cf75b9b31e81acf9570ab07cc59fe95408816f
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri Jul 24 18:55:23 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Fri Jul 24 18:55:23 2015 +0200

    Don't install tags that are already installed
    
    The code was installing all the tags it found, even in the cases
    the tag was already installed, creating wrong symbols without
    type.

diff --git a/cc1/decl.c b/cc1/decl.c
index 4af9314..c16c9ac 100644
--- a/cc1/decl.c
+++ b/cc1/decl.c
_AT_@ -303,7 +303,8 @@ newtag(void)
         case IDEN:
         case TYPEIDEN:
                 sym = yylval.sym;
- install(NS_TAG);
+ if ((sym->flags & ISDEFINED) == 0)
+ install(NS_TAG);
                 next();
                 break;
         default:
_AT_@ -317,7 +318,6 @@ newtag(void)
                 sym->type->ns = ns++;
         }
 
- sym->flags |= ISDEFINED;
         if ((op = sym->type->op) != tag && op != INT)
                 error("'%s' defined as wrong kind of tag", sym->name);
         return sym;
Received on Fri Jul 24 2015 - 19:02:32 CEST

This archive was generated by hypermail 2.3.0 : Fri Jul 24 2015 - 19:12:11 CEST