[hackers] [scc] Fix error in popctx() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Tue, 18 Aug 2015 10:02:55 +0200 (CEST)

commit f20cb974e12e176500a0f44c4ebf3332e26dc463
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Mon Aug 17 10:43:09 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Mon Aug 17 10:43:09 2015 +0200

    Fix error in popctx()
    
    f was used without any initialization in the label case.

diff --git a/cc1/symbol.c b/cc1/symbol.c
index 66f50a2..1088b0d 100644
--- a/cc1/symbol.c
+++ b/cc1/symbol.c
_AT_@ -109,9 +109,10 @@ popctx(void)
                 localcnt = 0;
                 for (sym = labels; sym; sym = next) {
                         next = sym->next;
+ f = sym->flags;
                         if ((f & (ISUSED|ISDECLARED)) == ISDECLARED)
                                 warn("'%s' defined but not used", sym->name);
- if ((sym->flags & ISDECLARED) == 0)
+ if ((f & ISDECLARED) == 0)
                                 printerr("label '%s' is not defined", sym->name);
                         free(sym->name);
                         free(sym);
_AT_@ -121,16 +122,16 @@ popctx(void)
 
         for (sym = head; sym && sym->ctx > curctx; sym = next) {
                 next = sym->next;
+ f = sym->flags;
                 if (sym->ns == NS_TAG)
                         sym->type->defined = 0;
                 if (sym->name) {
- f = sym->flags;
                         unlinkhash(sym);
                         if ((f & (ISUSED|ISGLOBAL|ISDECLARED)) == ISDECLARED)
                                 warn("'%s' defined but not used", sym->name);
                 }
                 free(sym->name);
- if (sym->flags & ISSTRING)
+ if (f & ISSTRING)
                         free(sym->u.s);
                 free(sym);
         }
Received on Tue Aug 18 2015 - 10:02:55 CEST

This archive was generated by hypermail 2.3.0 : Tue Aug 18 2015 - 10:12:14 CEST