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:
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun box(): String {
|
||||
run {
|
||||
run {
|
||||
var x1 = 0
|
||||
run { ++x1 }
|
||||
if (x1 == 0) return "fail"
|
||||
}
|
||||
|
||||
run {
|
||||
var x2 = 0
|
||||
run { x2++ }
|
||||
if (x2 == 0) return "fail"
|
||||
}
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
|
||||
// Shared variable slots (x1, x2):
|
||||
// 5 ILOAD 0
|
||||
// 4 ISTORE 0
|
||||
|
||||
// Temporary variable slots for 'x2++':
|
||||
// 1 ILOAD 1
|
||||
// 1 ISTORE 1
|
||||
|
||||
// 0 NEW
|
||||
// 0 GETFIELD
|
||||
// 0 PUTFIELD
|
||||
Reference in New Issue
Block a user