as: Don't define lables until end of line - scc - simple c99 compiler
 (HTM) git clone git://git.simple-cc.org/scc
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Submodules
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 10f4504a3888a07d7650bf4aaab209df283b46ad
 (DIR) parent 052565e529cb91b36cffc7783eac387367f18d64
 (HTM) Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
       Date:   Sun, 11 Feb 2024 08:23:14 +0100
       
       as: Don't define lables until end of line
       
       As the label of the line can be used in EQU statements
       that modify the value of the label we cannot set the
       define flag until the end of the line or we will have
       a redefine error.
       
       Diffstat:
         M src/cmd/as/main.c                   |       3 +++
         M src/cmd/as/symbol.c                 |       1 -
       
       2 files changed, 3 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/src/cmd/as/main.c b/src/cmd/as/main.c
       @@ -131,6 +131,9 @@ dopass(char *fname)
                                translate(line.op, line.args);
                        else if (line.args)
                                error("arguments without an opcode");
       +
       +                if (linesym)
       +                        linesym->flags |= FDEF;
                }
        
                return nerrors == 0;
 (DIR) diff --git a/src/cmd/as/symbol.c b/src/cmd/as/symbol.c
       @@ -106,7 +106,6 @@ deflabel(char *name)
                        error("redefinition of label '%s'", name);
                if (cursec->flags & SABS)
                        sym->flags |= FABS;
       -        sym->flags |= FDEF;
                sym->value = cursec->curpc;
                sym->section = cursec;