Put default value (null or zero) to slot for uninitialized values

This way range of the variable is correct in LVT.
 #KT-24672 Fixed
This commit is contained in:
Ilmir Usmanov
2018-12-26 17:56:44 +03:00
parent 8ab9226805
commit a52f430d8f
14 changed files with 360 additions and 0 deletions
@@ -0,0 +1,16 @@
// IGNORE_BACKEND: JVM_IR
inline fun <reified T> foo(default: T): T {
val t: T
run {
t = default
}
return t
}
fun test() {
foo(0.0f)
}
// 2 ASTORE 1
// 1 LOCALVARIABLE t\$iv Ljava/lang/Object; L2 L11 1