[hackers] [scc] [cc1] fix continue statement within do loop || Quentin Rameau

From: <git_AT_suckless.org>
Date: Sat, 14 Jan 2017 20:34:26 +0100 (CET)

commit 976603250601c41b01e0c99788cbac58dc66d723
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Sat Jan 14 18:46:55 2017 +0100
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Sat Jan 14 18:46:55 2017 +0100

    [cc1] fix continue statement within do loop

diff --git a/cc1/stmt.c b/cc1/stmt.c
index 5f02531..3c7b907 100644
--- a/cc1/stmt.c
+++ b/cc1/stmt.c
_AT_@ -131,21 +131,26 @@ For(Symbol *lbreak, Symbol *lcont, Switch *lswitch)
 static void
 Dowhile(Symbol *lbreak, Symbol *lcont, Switch *lswitch)
 {
- Symbol *begin, *end;
+ Symbol *begin;
         Node *np;
 
         begin = newlabel();
- end = newlabel();
+ lcont = newlabel();
+ lbreak = newlabel();
+
         expect(DO);
+
         emit(OBLOOP, NULL);
         emit(OLABEL, begin);
- stmt(end, begin, lswitch);
+ stmt(lbreak, lcont, lswitch);
         expect(WHILE);
         np = condition();
+ 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:27 CET