commit 96e6976155ca954ce9abeb308640e28901211479
parent b00898d90c39c522aa074b10448d6c72c4176683
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Fri, 20 Mar 2015 12:58:42 -0400
Fix error in imm()
imm() was reserving space for only a pointer to Symbol,
not for the symbol itself.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cc2/parser.c b/cc2/parser.c
@@ -235,7 +235,7 @@ imm(TINT i)
np->op = CONST;
np->type = l_int16;
/* FIX: memory leak */
- np->sym = xmalloc(sizeof(Symbol *));
+ np->sym = xmalloc(sizeof(Symbol));
np->sym->u.imm = i;
np->left = np->right = NULL;
return np;