shithub: scc

Download patch

ref: 40b00c1de02895be74d04bf1dd415920dc2256c4
parent: 59747e56d427dd7c5718042ee87d1b73231fe55a
author: Roberto E. Vargas Caballero <[email protected]>
date: Thu Jun 2 04:31:12 EDT 2016

[cc2-qbe] Fix the type in alloc assignation

The type in this assignation is not the type of the base code,
it is the type of the pointer in the current architecture,
that in our case is the type ptrtype.

--- a/cc2/arch/qbe/code.c
+++ b/cc2/arch/qbe/code.c
@@ -295,9 +295,10 @@
 alloc(Symbol *sym)
 {
 	Type *tp = &sym->type;
+	extern Type ptrtype;
 
 	printf("\t%s =%s\talloc%lu\t%lu\n",
-	       symname(sym), size2asm(tp), tp->size, tp->align);
+	       symname(sym), size2asm(&ptrtype), tp->size, tp->align);
 }
 
 void