From 331b085b2f5fe951692e0f45dfe4c795f8861320 Mon Sep 17 00:00:00 2001 From: Jiaxiang Chen Date: Wed, 13 Nov 2019 17:20:03 -0800 Subject: [PATCH] JVM_IR: Fix line number for catch clause. --- .../jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt | 2 +- compiler/testData/debug/stepping/throwException.kt | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt index 1e2ab37463d..90b053d0092 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt @@ -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() diff --git a/compiler/testData/debug/stepping/throwException.kt b/compiler/testData/debug/stepping/throwException.kt index c53a580df36..ad7ec1dadda 100644 --- a/compiler/testData/debug/stepping/throwException.kt +++ b/compiler/testData/debug/stepping/throwException.kt @@ -14,8 +14,6 @@ fun throwIfLess(a: Int, b: Int) { if (a