shithub: scc

Download patch

ref: 20cea36cf1e5f8278cd79cd3e9b7905bfbac483e
parent: 489d4004127ad5b60f46ddd1c076534c6c583230
author: Roberto E. Vargas Caballero <[email protected]>
date: Sat Sep 26 15:47:51 EDT 2015

Install parameter macros in the symbol table

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

--- a/cc1/cpp.c
+++ b/cc1/cpp.c
@@ -247,6 +247,7 @@
 getpars(Symbol *args[NR_MACROARG])
 {
 	int n = -1;
+	Symbol *sym;
 
 	if (!accept('('))
 		return n;
@@ -263,7 +264,9 @@
 			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(')');
--- 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
 }
 */