commit 20cea36cf1e5f8278cd79cd3e9b7905bfbac483e
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Sat Sep 26 19:47:51 2015 +0200
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Sat Sep 26 19:51:42 2015 +0200

    Install parameter macros in the symbol table
    
    Due to the new implementation of the symbol table
    it is always needed a call to install().

diff --git a/cc1/cpp.c b/cc1/cpp.c
index ce24967..5bc0515 100644
--- a/cc1/cpp.c
+++ b/cc1/cpp.c
@@ -247,6 +247,7 @@ static int
 getpars(Symbol *args[NR_MACROARG])
 {
        int n = -1;
+       Symbol *sym;
 
        if (!accept('('))
                return n;
@@ -263,7 +264,9 @@ getpars(Symbol *args[NR_MACROARG])
                        cpperror("macro arguments must be identifiers");
                        return NR_MACROARG;
                }
-               args[n++] = yylval.sym;
+               sym = install(NS_IDEN, yylval.sym);
+               sym->flags |= ISUSED;
+               args[n++] = sym;
                next();
        } while (accept(','));
        expect(')');
diff --git a/cc1/tests/test026.c b/cc1/tests/test026.c
index 6003650..24c7398 100644
--- a/cc1/tests/test026.c
+++ b/cc1/tests/test026.c
@@ -3,18 +3,18 @@
 name: TEST026
 descritpion: Test of predefined cpp macros
 output:
-F1
-G2     F1      main
+F2
+G3     F2      main
 {
 \
-A3     I       y
-A5     P       p
-       A5      "746573743032362E63     'P      :P
-       A3      #I1E    :I
-       A3      #I1     :I
-       A3      #I1     :I
-       A3      #I1     :I
-       A3      A3      :I
+A4     I       y
+A6     P       p
+       A6      "746573743032362E63     'P      :P
+       A4      #I1E    :I
+       A4      #I1     :I
+       A4      #I1     :I
+       A4      #I1     :I
+       A4      #I1     :I
 }
 */
 

Reply via email to