Loops are followed by read(Unit) in order to prevent the CFA from thinking that the condition is returned

This commit is contained in:
Andrey Breslav
2011-04-14 19:53:32 +04:00
parent 9d32723cbf
commit 5963e952da
5 changed files with 69 additions and 12 deletions
@@ -0,0 +1,42 @@
== main ==
fun main() {
while(1 > 0) {
2
}
}
---------------------
l0:
<START>
l3:
r(1)
r(0)
r(>)
r(1 > 0)
jf(l2)
r(2)
jmp(l3)
l2:
read (Unit)
l1:
<END>
=====================
== dowhile ==
fun dowhile() {
do {return}
while(1 > 0)
}
---------------------
l0:
<START>
l3:
ret l1
r(1)
r(0)
r(>)
r(1 > 0)
jt(l3)
l2:
read (Unit)
l1:
<END>
=====================