Report 'break or continue outside a loop'

for break/continue outside a loop body (e.g. in loop condition)

 #KT-5724 Fixed
This commit is contained in:
Svetlana Isakova
2014-09-01 19:01:47 +04:00
parent 0b4f313b6d
commit 61dc110cc7
22 changed files with 355 additions and 275 deletions
@@ -9,7 +9,7 @@ L0:
1 <START>
2 mark({ while(0 > 1) { 2 } })
L2 [loop entry point]:
L5 [condition entry point]:
L6 [condition entry point]:
r(0) -> <v0> PREV:[mark({ while(0 > 1) { 2 } }), jmp(L2 [loop entry point])]
r(1) -> <v1>
mark(0 > 1)
@@ -21,6 +21,7 @@ L4 [body entry point]:
r(2) -> <v3>
2 jmp(L2 [loop entry point]) NEXT:[r(0) -> <v0>]
L3 [loop exit point]:
L5 [body exit point]:
read (Unit) PREV:[jf(L3 [loop exit point]|<v2>)]
L1:
1 <END> NEXT:[<SINK>]
@@ -43,7 +44,8 @@ L2 [loop entry point]:
L4 [body entry point]:
mark({return})
ret L1 NEXT:[<END>]
L5 [condition entry point]:
L5 [body exit point]:
L6 [condition entry point]:
- r(0) -> <v1> PREV:[]
- r(1) -> <v2> PREV:[]
- mark(0 > 1) PREV:[]