scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 3af0039562d8ff0baaddc57d9caa36fe10b2ba16
parent d96672c3e87b42ba8e269bd72386ee2431c3134c
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu,  2 Jun 2016 08:31:12 +0200

[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.

Diffstat:
cc2/arch/qbe/code.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c @@ -295,9 +295,10 @@ static void 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