02b40326cc
If all the suspension calls in a suspend function were "hidden" under the for-convention (iterator/next/hasNext) calls, control-flow didn't find them, thus supposing that there is no suspension points and there is no need to generate a coroutine state machine The solution is to add relevant calls to CFG #KT-15824 Fixed
22 lines
1.2 KiB
Plaintext
Vendored
22 lines
1.2 KiB
Plaintext
Vendored
== test ==
|
|
fun test(b: Boolean) {
|
|
for (i in 1..10) {
|
|
if (b) break;
|
|
continue;
|
|
}
|
|
}
|
|
---------------------
|
|
<v0>: Boolean NEW: magic[FAKE_INITIALIZER](b: Boolean) -> <v0>
|
|
<v7>: Int NEW: magic[LOOP_RANGE_ITERATION](1..10|<v6>) -> <v7>
|
|
1 <v1>: Int NEW: r(1) -> <v1>
|
|
10 <v2>: Int NEW: r(10) -> <v2>
|
|
1..10 <v6>: {<: Iterable<Int>} NEW: call(1..10, next) -> <v6>
|
|
b <v8>: Boolean NEW: r(b) -> <v8>
|
|
break !<v9>: *
|
|
if (b) break <v10>: * NEW: merge(if (b) break|!<v9>) -> <v10>
|
|
continue !<v11>: *
|
|
{ if (b) break; continue; } !<v11>: * COPY
|
|
for (i in 1..10) { if (b) break; continue; } !<v12>: *
|
|
{ for (i in 1..10) { if (b) break; continue; } } !<v12>: * COPY
|
|
=====================
|