[JVM_IR] Keep track of catch variable gaps.

This ensures that catch variables are not visible in duplicated
finally blocks generated at an exit within the catch variable
scope.

^KT-46449 Fixed
This commit is contained in:
Mads Ager
2021-06-14 13:16:41 +02:00
committed by max-kammerer
parent 6aba6ea670
commit ae03e2983d
5 changed files with 15 additions and 18 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ fun compute(): String {
}
}
} finally {
x = "OK" // TODO: `e` should not be visible here.
x = "OK"
}
return "FAIL"
}
@@ -45,7 +45,7 @@ fun box() {
// test.kt:18 compute: e:java.lang.Exception=java.lang.RuntimeException, y:int=32:int, j:int=0:int
// test.kt:4 compute: e:java.lang.Exception=java.lang.RuntimeException, y:int=32:int, j:int=0:int, $i$f$f:int=0:int
// test.kt:19 compute: e:java.lang.Exception=java.lang.RuntimeException, y:int=32:int, j:int=0:int, $i$f$f:int=0:int, $i$a$-f-TestKt$compute$1:int=0:int
// test.kt:23 compute: e:java.lang.Exception=java.lang.RuntimeException
// test.kt:23 compute:
// test.kt:29 box:
// test.kt:30 box: result:java.lang.String="NON_LOCAL_RETURN":java.lang.String
// test.kt:31 box: result:java.lang.String="NON_LOCAL_RETURN":java.lang.String, localX:java.lang.String="OK":java.lang.String