shithub: scc

Download patch

ref: 5e9e3c00f29aabac133ecce2b1b3c7a29b5816a2
parent: c677d8a0ea50a1a005d88f82c17c30c345549642
author: Roberto E. Vargas Caballero <[email protected]>
date: Thu Jun 2 13:26:19 EDT 2016

[cc2-qbe] Do not emit local types

Local types are represented by local symbols,
and in writeout we were writing all the local
symbols that we had, including the types.
Types has no kind (or class storage), so we can
detect them checking that we have some kind in
the symbol.

--- a/cc2/arch/qbe/code.c
+++ b/cc2/arch/qbe/code.c
@@ -328,7 +328,7 @@
 
 	/* allocate stack space for local variables) */
 	for ( ; p && p->id != TMPSYM; p = p->next) {
-		if (p->kind != SLABEL)
+		if (p->kind && p->kind != SLABEL)
 			alloc(p);
 	}
 	/* store formal parameters in parameters */