mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 08:31:35 +00:00
See KT-36812. Aside from the problem stated there, D8 will throw out the entire LVT if it sees a variable that has not been written to (and will generate incorrect SSA if the slot is reused with a different type). Note: this only fixes a FIR test because it's missing an `else -> throw` branch, and default initialization satisfies the verifier and masks the incorrect control flow.
13 lines
246 B
Kotlin
Vendored
13 lines
246 B
Kotlin
Vendored
// IGNORE_BACKEND: JVM_IR
|
|
// TODO KT-36648 Captured variables not optimized in JVM_IR
|
|
|
|
fun test(): UInt {
|
|
var c: UInt
|
|
run {
|
|
c = 1u
|
|
}
|
|
return c
|
|
}
|
|
|
|
// 1 ASTORE 0
|
|
// 1 LOCALVARIABLE c Lkotlin/jvm/internal/Ref\$IntRef; L1 L.* 0 |