JVM_IR: Fix line number for catch clause.
This commit is contained in:
committed by
Ilmir Usmanov
parent
3ea878b1c6
commit
331b085b2f
+1
-1
@@ -796,10 +796,10 @@ class ExpressionCodegen(
|
|||||||
val parameter = clause.catchParameter
|
val parameter = clause.catchParameter
|
||||||
val descriptorType = parameter.asmType
|
val descriptorType = parameter.asmType
|
||||||
val index = frameMap.enter(clause.catchParameter, descriptorType)
|
val index = frameMap.enter(clause.catchParameter, descriptorType)
|
||||||
|
clause.markLineNumber(true)
|
||||||
mv.store(index, descriptorType)
|
mv.store(index, descriptorType)
|
||||||
|
|
||||||
val catchBody = clause.result
|
val catchBody = clause.result
|
||||||
catchBody.markLineNumber(true)
|
|
||||||
val catchResult = catchBody.accept(this, data)
|
val catchResult = catchBody.accept(this, data)
|
||||||
if (savedValue != null) {
|
if (savedValue != null) {
|
||||||
catchResult.coerce(tryAsmType, aTry.type).materialize()
|
catchResult.coerce(tryAsmType, aTry.type).materialize()
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ fun throwIfLess(a: Int, b: Int) {
|
|||||||
if (a<b)
|
if (a<b)
|
||||||
throw java.lang.IllegalStateException()
|
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
|
// LINENUMBERS
|
||||||
// TestKt.box():3
|
// TestKt.box():3
|
||||||
// TestKt.box():4
|
// TestKt.box():4
|
||||||
|
|||||||
Reference in New Issue
Block a user