mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-17 15:54:03 +00:00
- fix SAVE_STACK_BEFORE_TRY insertion:
TRYCATCHBLOCK LA, LB, LC
LA
NOP
try_body
LB
...
LC
handler_body
should be transformed into:
LA
{SAVE_STACK_BEFORE_TRY}
LA' // new TCB start label
NOP
try_body
LB
...
LC
handler_body
with all TCBs start labels remapped
- properly wrap exceptions from MandatoryMethodTransformer
#KT-8608 Fixed
30 lines
600 B
Kotlin
Vendored
30 lines
600 B
Kotlin
Vendored
interface Callable {
|
|
fun call(b: Boolean)
|
|
}
|
|
|
|
inline fun run(f: () -> Unit) { f() }
|
|
|
|
class A {
|
|
fun foo(): String {
|
|
run {
|
|
val x = object : Callable {
|
|
override fun call(b: Boolean) {
|
|
if (b) {
|
|
x()
|
|
} else {
|
|
try {
|
|
x()
|
|
} catch(t: Throwable) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return "OK"
|
|
}
|
|
|
|
private fun x() {}
|
|
}
|
|
|
|
fun box(): String =
|
|
A().foo() |