commit cde05e319be1e511ff3dd66a15ba048e09876de3
parent 52efd1500ebcdd1b19b7ec791a5d1e427b655ab7
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Mon, 16 Mar 2015 10:28:58 +0000
Fix automatic addressing
SP always point to the last correct value, so, IX points
to the previous value of IX in the stack. It means that all
the address in the stack must be passed this last value.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cc2/parser.c b/cc2/parser.c
@@ -511,7 +511,7 @@ localdcl(char *token)
if (sclass == 'A' || sclass == 'R') {
curfun->u.f.locals += sym->u.v.type.size;
- sym->u.v.off = 1-curfun->u.f.locals;
+ sym->u.v.off = curfun->u.f.locals;
}
}