JVM_IR: Fix line number for catch clause.

This commit is contained in:
Jiaxiang Chen
2019-11-13 17:20:03 -08:00
committed by Ilmir Usmanov
parent 3ea878b1c6
commit 331b085b2f
2 changed files with 1 additions and 3 deletions
@@ -796,10 +796,10 @@ class ExpressionCodegen(
val parameter = clause.catchParameter
val descriptorType = parameter.asmType
val index = frameMap.enter(clause.catchParameter, descriptorType)
clause.markLineNumber(true)
mv.store(index, descriptorType)
val catchBody = clause.result
catchBody.markLineNumber(true)
val catchResult = catchBody.accept(this, data)
if (savedValue != null) {
catchResult.coerce(tryAsmType, aTry.type).materialize()
-2
View File
@@ -14,8 +14,6 @@ fun throwIfLess(a: Int, b: Int) {
if (a<b)
throw java.lang.IllegalStateException()
}
// IGNORE_BACKEND: JVM_IR
// after throwing exception in try block, IR backend is returning a line number at line 6 instead of line 7 where catch statement is in.
// LINENUMBERS
// TestKt.box():3
// TestKt.box():4