commit 3af0039562d8ff0baaddc57d9caa36fe10b2ba16
Author: Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Thu Jun 2 08:31:12 2016 +0200
Commit: Roberto E. Vargas Caballero <[email protected]>
CommitDate: Thu Jun 2 08:31:12 2016 +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.
diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c
index 6e23894..62c78e9 100644
--- 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