shithub: scc

Download patch

ref: ac1f52ccad9cb7919726a64c458763eb78f5dd4a
parent: b9a6331f4400d1372d2747c8dd371fefe6576a60
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue May 13 08:42:41 EDT 2014

Fix structure field declaration

newfield() has to receive a pointer to the struct type, but a pointer
to the type of the field was passed.

--- a/cc1/decl.c
+++ b/cc1/decl.c
@@ -315,7 +315,7 @@
 	if (yytoken != ';') {
 		do {
 			sym = declarator(tp, ns, ID_EXPECTED);
-			newfield(tp, sym);
+			newfield(base, sym);
 		} while (accept(','));
 	}