Inline: need to clone all arguments for inline function call

This commit is contained in:
Igor Chevdar
2017-04-03 17:31:59 +03:00
parent 791712a22a
commit fffbff1365
@@ -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