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:
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);