[hackers] [scc] [cc1] fix continue statement within while loop || Quentin Rameau
commit 4ec218b3c3bd1ee6738597225494dd0c2da7001c
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Sat Jan 14 18:43:00 2017 +0100
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Sat Jan 14 18:43:00 2017 +0100
[cc1] fix continue statement within while loop
diff --git a/cc1/stmt.c b/cc1/stmt.c
index 5b59e75..5f02531 100644
--- a/cc1/stmt.c
+++ b/cc1/stmt.c
_AT_@ -69,24 +69,27 @@ condition(void)
static void
While(Symbol *lbreak, Symbol *lcont, Switch *lswitch)
{
- Symbol *begin, *cond, *end;
+ Symbol *begin;
Node *np;
begin = newlabel();
- end = newlabel();
- cond = newlabel();
+ lcont = newlabel();
+ lbreak = newlabel();
expect(WHILE);
np = condition();
- emit(OJUMP, cond);
+
+ emit(OJUMP, lcont);
+
emit(OBLOOP, NULL);
emit(OLABEL, begin);
- stmt(end, begin, lswitch);
- emit(OLABEL, cond);
+ stmt(lbreak, lcont, lswitch);
+ emit(OLABEL, lcont);
emit(OBRANCH, begin);
emit(OEXPR, np);
emit(OELOOP, NULL);
- emit(OLABEL, end);
+
+ emit(OLABEL, lbreak);
}
static void
Received on Sat Jan 14 2017 - 20:34:26 CET
This archive was generated by hypermail 2.3.0
: Sat Jan 14 2017 - 20:36:23 CET