scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit d5e80faa2bd461ee5c53ea81329347cb8a530369
parent 72c078099ff413a22007b90784238bb294dd7dbe
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat, 18 Jun 2022 09:41:01 +0200

cc1: Expect semicolon after do-while

Diffstat:
Msrc/cmd/cc/cc1/stmt.c | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/cmd/cc/cc1/stmt.c b/src/cmd/cc/cc1/stmt.c @@ -156,9 +156,12 @@ Dowhile(Symbol *lbreak, Symbol *lcont, Switch *lswitch) emit(OBLOOP, NULL); emit(OLABEL, begin); + stmt(lbreak, lcont, lswitch); expect(WHILE); np = condition(NONEGATE); + expect(';'); + emit(OLABEL, lcont); emit(OBRANCH, begin); emit(OEXPR, np);