61dc110cc7
for break/continue outside a loop body (e.g. in loop condition) #KT-5724 Fixed
59 lines
1.9 KiB
Plaintext
59 lines
1.9 KiB
Plaintext
== foo ==
|
|
fun foo(c: Collection<Int>) {
|
|
for (e in c) {
|
|
{
|
|
break
|
|
}
|
|
}
|
|
}
|
|
---------------------
|
|
L0:
|
|
1 <START>
|
|
v(c: Collection<Int>)
|
|
magic[FAKE_INITIALIZER](c: Collection<Int>) -> <v0>
|
|
w(c|<v0>)
|
|
2 mark({ for (e in c) { { break } } })
|
|
3 r(c) -> <v1>
|
|
v(e)
|
|
L2 [loop entry point]:
|
|
L6 [condition entry point]:
|
|
jmp?(L3 [loop exit point]) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](c|<v1>) -> <v2>] PREV:[v(e), jmp(L2 [loop entry point])]
|
|
magic[LOOP_RANGE_ITERATION](c|<v1>) -> <v2>
|
|
w(e|<v2>)
|
|
mark(for (e in c) { { break } })
|
|
L4 [body entry point]:
|
|
4 mark({ { break } })
|
|
mark({ break })
|
|
jmp?(L7 [after local declaration]) NEXT:[r({ break }) -> <v3>, d({ break })]
|
|
d({ break }) NEXT:[<SINK>]
|
|
L7 [after local declaration]:
|
|
r({ break }) -> <v3> PREV:[jmp?(L7 [after local declaration])]
|
|
3 jmp(L2 [loop entry point]) NEXT:[jmp?(L3 [loop exit point])]
|
|
L3 [loop exit point]:
|
|
L5 [body exit point]:
|
|
read (Unit) PREV:[jmp?(L3 [loop exit point]), jmp(L3 [loop exit point])]
|
|
L1:
|
|
1 <END> NEXT:[<SINK>]
|
|
error:
|
|
<ERROR> PREV:[]
|
|
sink:
|
|
<SINK> PREV:[<ERROR>, <END>, d({ break })]
|
|
=====================
|
|
== anonymous_0 ==
|
|
{
|
|
break
|
|
}
|
|
---------------------
|
|
L8:
|
|
5 <START>
|
|
6 mark(break)
|
|
jmp(L3 [loop exit point]) NEXT:[read (Unit)]
|
|
- 5 ret(*|!<v0>) L9 PREV:[]
|
|
L9:
|
|
<END> NEXT:[<SINK>] PREV:[]
|
|
error:
|
|
<ERROR> PREV:[]
|
|
sink:
|
|
<SINK> PREV:[<ERROR>, <END>]
|
|
=====================
|