commit ed9dc0fc53e6c6073a55941f41b4c4d907547364
parent 4f26471416516e201f2d0efdfb87f601a5682134
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Tue, 16 Sep 2014 20:16:12 +0200
Fix offset of auto variables
Typical error 1+.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cc2/parser.c b/cc2/parser.c
@@ -434,8 +434,8 @@ static void
localdcl(char *token)
{
Symbol *sym = declaration(LOCAL, token[0], token);
- sym->u.v.off = -curfun->u.f.locals;
curfun->u.f.locals += sym->u.v.type->size;
+ sym->u.v.off = 1-curfun->u.f.locals;
}
void