Add NOP as first instruction in coroutine's try blocks

#KT-35035 Fixed
This commit is contained in:
Ilmir Usmanov
2019-12-02 21:32:18 +03:00
parent 4777dd652b
commit df0a86ea57
9 changed files with 85 additions and 3 deletions
@@ -0,0 +1,50 @@
// FILE: test.kt
// WITH_RUNTIME
// WITH_COROUTINES
// CHECK_STATE_MACHINE
// NO_CHECK_LAMBDA_INLINING
import helpers.*
import kotlin.coroutines.*
const val DEBUG = false
inline fun inlineFun(b: () -> Unit) {
if (DEBUG) {
inlineFunReal(b)
}
}
inline fun inlineFunReal(b: () -> Unit) {
try {
b()
} finally {
}
}
fun builder(c: suspend () -> Unit) {
c.startCoroutine(CheckStateMachineContinuation)
}
// FILE: box.kt
import helpers.*
class Sample {
fun test() {
inlineFun {
builder {
inlineFun {
suspendFun()
suspendFun()
}
}
}
}
suspend fun suspendFun() = StateMachineChecker.suspendHere()
}
fun box(): String {
Sample().test()
StateMachineChecker.check(0, checkFinished = false)
return "OK"
}