commit c484ab23ccfb44b48143d8dd77e8f281ba8b012b
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Mon Oct 5 16:41:58 2015 +0200
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Mon Oct 5 16:41:58 2015 +0200

    Fix defined() parsing
    
    primary() was calling after notdefined(), which consumed all the
    tokens for 'defined(macro)'.

diff --git a/cc1/expr.c b/cc1/expr.c
index 6ec964b..3b106a0 100644
--- a/cc1/expr.c
+++ b/cc1/expr.c
@@ -534,15 +534,16 @@ primary(void)
        sym = yylval.sym;
        switch (yytoken) {
        case CONSTANT:
-       constant:
                np = constnode(sym);
                next();
                break;
        case IDEN:
                if ((sym->flags & ISDECLARED) == 0)
                        sym = notdefined(sym);
-               if (sym->flags & ISCONSTANT)
-                       goto constant;
+               if (sym->flags & ISCONSTANT) {
+                       np = constnode(sym);
+                       break;
+               }
                sym->flags |= ISUSED;
                np = varnode(sym);
                next();

Reply via email to