From c3b0c9c6b29f0a45065842d56aea37141fa046c7 Mon Sep 17 00:00:00 2001 From: Ivan Kylchik Date: Fri, 7 Aug 2020 13:45:48 +0300 Subject: [PATCH] Support multiple nested try blocks --- .../org/jetbrains/kotlin/ir/interpreter/IrInterpreter.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/IrInterpreter.kt b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/IrInterpreter.kt index 0f2309dbb10..954d143d5fd 100644 --- a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/IrInterpreter.kt +++ b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/IrInterpreter.kt @@ -728,14 +728,13 @@ class IrInterpreter(private val irBuiltIns: IrBuiltIns, private val bodyMap: Map for (catchBlock in expression.catches) { if (exception.isSubtypeOf(catchBlock.catchParameter.type.classOrNull!!.owner)) { catchBlock.interpret().check { return it } - break + return Next } } + return Exception } finally { - expression.finallyExpression?.interpret()?.check { return it } + expression.finallyExpression?.takeIf { (it as? IrBlock)?.statements?.isEmpty() != true }?.interpret()?.check { return it } } - - return Next } private fun interpretCatch(expression: IrCatch): ExecutionResult {