From fffbff1365dccd21f9c875478c13ce36d1c2d54c Mon Sep 17 00:00:00 2001 From: Igor Chevdar Date: Mon, 3 Apr 2017 17:31:59 +0300 Subject: [PATCH] Inline: need to clone all arguments for inline function call --- .../jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt index 9b5a75a90b7..02d4ce1248a 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt @@ -288,7 +288,7 @@ internal class FunctionInlining(val context: Context): IrElementTransformerVoid( override fun visitGetValue(expression: IrGetValue): IrExpression { val newExpression = super.visitGetValue(expression) as IrGetValue val descriptor = newExpression.descriptor - val argument = substituteMap[descriptor] // Find expression to replace this parameter. + val argument = substituteMap[descriptor]?.accept(InlineCopyIr(), null) as IrExpression? // Find expression to replace this parameter. if (argument == null) return newExpression // If there is no such expression - do nothing return argument