[JVM IR] Generate line number for exception store for finally.

^KT-46451 Fixed
This commit is contained in:
Mads Ager
2021-08-19 13:51:27 +02:00
committed by Alexander Udalov
parent a1519b7b4e
commit 0b84de31b7
7 changed files with 43 additions and 2 deletions
@@ -34,4 +34,5 @@ fun box(): String {
// test.kt:11 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException, y:java.lang.String="y":java.lang.String
// test.kt:12 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException, y:java.lang.String="y":java.lang.String, z:java.lang.String="z":java.lang.String
// test.kt:14 box: i:int=0:int
// test.kt:17 box:
// test.kt:18 box:
@@ -34,4 +34,5 @@ fun box(): String {
// test.kt:11 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException, y:java.lang.String="y":java.lang.String
// test.kt:12 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException, y:java.lang.String="y":java.lang.String, z:java.lang.String="z":java.lang.String
// test.kt:14 box: i:int=0:int
// test.kt:17 box:
// test.kt:18 box:
+22
View File
@@ -0,0 +1,22 @@
// FILE: test.kt
fun box(): String {
try {
val x = "x"
throw RuntimeException(x)
} finally {
return "OK"
}
return "FAIL"
}
// IGNORE_BACKEND: JVM
// The old backend steps on line 4, 5, 9, and 8. No step on the throw, and a step on the end
// brace of the finally before going into the actual finally code.
// LOCAL VARIABLES
// test.kt:4 box:
// test.kt:5 box:
// test.kt:6 box: x:java.lang.String="x":java.lang.String
// test.kt:7 box:
// test.kt:8 box:
+3 -2
View File
@@ -69,8 +69,9 @@ fun box() {
// test.kt:10 foo
// test.kt:11 foo
// test.kt:25 mightThrow2
// test.kt:14 foo
// LINENUMBERS JVM
// test.kt:14 foo
// test.kt:10 foo
// LINENUMBERS JVM_IR
// test.kt:13 foo
// test.kt:12 foo
// test.kt:13 foo