scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 34628a2ca10f9ca38785ec744ffc4b5e012fe86e
parent c01089f9b88ed71f3adcd21814216ea3dc262cf6
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 10 Feb 2015 17:45:41 +0100

Fix definition of for loops in cc1

There was an error, because for expected a ';' instead of a ')'
before the statement of the body of the loop.

Diffstat:
Mcc1/stmt.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cc1/stmt.c b/cc1/stmt.c @@ -108,7 +108,7 @@ For(Symbol *lbreak, Symbol *lcont, Caselist *lswitch) econd = (yytoken != ';') ? expr() : NULL; expect(';'); einc = (yytoken != ')') ? expr() : NULL; - expect(';'); + expect(')'); emitexp(einit); emitjump(cond, NULL);