mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
KT-5248 Don't wrap variable if it is captured only in inlined closures
Remove non-escaping Ref's on bytecode postprocessing pass.
This commit is contained in:
14
compiler/testData/codegen/bytecodeText/capturedVarsOptimization/withStackNormalization.kt
vendored
Normal file
14
compiler/testData/codegen/bytecodeText/capturedVarsOptimization/withStackNormalization.kt
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun add(x: Int, y: Int) = x + y
|
||||
|
||||
fun test() {
|
||||
var x = 0
|
||||
run {
|
||||
x += add(1, try { 1 } catch (e: Throwable) { 42 })
|
||||
}
|
||||
}
|
||||
|
||||
// 0 NEW
|
||||
// 0 GETFIELD
|
||||
// 0 PUTFIELD
|
||||
Reference in New Issue
Block a user