shithub: scc

Download patch

ref: cf8e9e411ee41b2bdf227922c88038785319fc0c
parent: 1770b6f83b89855a47d3457c2a1c24127d033d43
author: Roberto E. Vargas Caballero <[email protected]>
date: Thu Apr 24 05:15:03 EDT 2014

Fix call to stmt in loops

The first parameter of stmt if the break label, so it must be end,
and not begin how the code was doing.

--- a/stmt.c
+++ b/stmt.c
@@ -53,7 +53,7 @@
 	emitjump(cond, NULL);
 	emitbloop();
 	emitlabel(begin);
-	stmt(begin, end, lswitch);
+	stmt(end, begin, lswitch);
 	emitlabel(cond);
 	emitjump(begin, np);
 	emiteloop();
@@ -80,7 +80,7 @@
 	emitjump(cond, NULL);
 	emitbloop();
 	emitlabel(begin);
-	stmt(begin, end, lswitch);
+	stmt(end, begin, lswitch);
 	if (einc)
 		emitexp(einc);
 	emitlabel(cond);
@@ -98,7 +98,7 @@
 	expect(DO);
 	emitbloop();
 	emitlabel(begin);
-	stmt(begin, end, lswitch);
+	stmt(end, begin, lswitch);
 	expect(WHILE);
 	emitjump(begin, condition());
 	emiteloop();