do...while (true) is now considered infinite loop in CFA #KT-3896 Fixed

Also #KT-3883 Fixed
Also #KT-4986 Fixed
This commit is contained in:
Mikhail Glukhikh
2016-03-11 19:27:08 +03:00
parent 4cf3ec3df2
commit 569a5888ff
11 changed files with 221 additions and 10 deletions
@@ -15,7 +15,7 @@ L0:
3 mark(do { if (b) break; continue; } while (true))
L2 [loop entry point]:
L4 [body entry point]:
mark({ if (b) break; continue; }) PREV:[mark(do { if (b) break; continue; } while (true)), jt(L2|<v5>)]
mark({ if (b) break; continue; }) PREV:[mark(do { if (b) break; continue; } while (true)), jmp(L2)]
mark(if (b) break)
r(b) -> <v1>
jf(L7|<v1>) NEXT:[read (Unit), jmp(L3)]
@@ -29,13 +29,14 @@ L8 ['if' expression result]:
L5 [body exit point]:
L6 [condition entry point]:
r(true) -> <v5>
jt(L2|<v5>) NEXT:[read (Unit), mark({ if (b) break; continue; })]
magic[VALUE_CONSUMER](true|<v5>) -> <v6>
jmp(L2) NEXT:[mark({ if (b) break; continue; })]
L3 [loop exit point]:
read (Unit) PREV:[jmp(L3), jt(L2|<v5>)]
read (Unit) PREV:[jmp(L3)]
L1:
1 <END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
=====================