[hackers] [scc] Call install() in label() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Fri, 21 Aug 2015 13:10:37 +0200 (CEST)

X-DEBUG-UPD: f426a4d4ddaad3eb752814fc040f0b180775ce16
commit f426a4d4ddaad3eb752814fc040f0b180775ce16
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue Aug 18 14:36:03 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Tue Aug 18 15:38:31 2015 +0200

    Call install() in label()
    
    The message of label() is outdated and current version
    of install() handles this situation, so we can call it directly.

diff --git a/cc1/stmt.c b/cc1/stmt.c
index f876452..d215c01 100644
--- a/cc1/stmt.c
+++ b/cc1/stmt.c
_AT_@ -20,18 +20,8 @@ label(void)
         switch (yytoken) {
         case IDEN:
         case TYPEIDEN:
- /*
- * We cannot call to insert() because the call to lookup in
- * lex.c was done in NS_IDEN namespace, and it is impossibe
- * to fix this point, because an identifier at the beginning
- * of a statement may be part of an expression or part of a
- * label. This double call to lookup() is going to generate
- * an undefined symbol that is not going to be used ever.
- */
- sym = lookup(NS_LABEL);
- if (sym->flags & ISDECLARED)
+ if ((sym = install(NS_LABEL, yylval.sym)) == NULL)
                         error("label '%s' already defined", yytoken);
- sym->flags |= ISDECLARED;
                 emit(OLABEL, sym);
                 next();
                 expect(':');
Received on Fri Aug 21 2015 - 13:10:37 CEST

This archive was generated by hypermail 2.3.0 : Fri Aug 21 2015 - 13:12:20 CEST