]> git.sur5r.net Git - cc65/commitdiff
Check register before static
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 24 Nov 2002 21:07:39 +0000 (21:07 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 24 Nov 2002 21:07:39 +0000 (21:07 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1624 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/cc65/expr.c

index 692ba4d55f445e43cc4fb5c907e8a41a518c11bf..aacc96891ddcee57e7e1ce687222e4bbdd450fb1 100644 (file)
@@ -938,6 +938,11 @@ static int primary (ExprDesc* lval)
                    lval->Flags = E_MLOCAL | E_TLOFFS;
                    lval->ConstVal = Sym->V.Offs;
                }
+           } else if ((Sym->Flags & SC_REGISTER) == SC_REGISTER) {
+               /* Register variable, zero page based */
+               lval->Flags = E_MGLOBAL | E_MCONST | E_TREGISTER;
+               lval->Name  = Sym->V.Offs;
+               lval->ConstVal = 0;
            } else if ((Sym->Flags & SC_STATIC) == SC_STATIC) {
                /* Static variable */
                if (Sym->Flags & (SC_EXTERN | SC_STORAGE)) {
@@ -948,11 +953,6 @@ static int primary (ExprDesc* lval)
                    lval->Name = Sym->V.Label;
                }
                lval->ConstVal = 0;
-           } else if ((Sym->Flags & SC_REGISTER) == SC_REGISTER) {
-               /* Register variable, zero page based */
-               lval->Flags = E_MGLOBAL | E_MCONST | E_TREGISTER;
-               lval->Name  = Sym->V.Offs;
-               lval->ConstVal = 0;
                    } else {
                /* Local static variable */
                lval->Flags = E_MGLOBAL | E_MCONST | E_TLLAB;