diff --git a/compiler/res/version.txt b/compiler/res/version.txt index 1f250bde9..22ec1e649 100644 --- a/compiler/res/version.txt +++ b/compiler/res/version.txt @@ -1 +1 @@ -8.10-dev +8.10 diff --git a/compiler/src/prog8/compiler/astprocessing/NotExpressionAndIfComparisonExprChanger.kt b/compiler/src/prog8/compiler/astprocessing/NotExpressionAndIfComparisonExprChanger.kt index bff62d575..d133fd0cc 100644 --- a/compiler/src/prog8/compiler/astprocessing/NotExpressionAndIfComparisonExprChanger.kt +++ b/compiler/src/prog8/compiler/astprocessing/NotExpressionAndIfComparisonExprChanger.kt @@ -153,17 +153,6 @@ internal class NotExpressionAndIfComparisonExprChanger(val program: Program, val if(compTarget.name == VMTarget.NAME) // don't apply this optimization for Vm target return CondExprSimplificationResult(null, null, null, null) - var leftAssignment: Assignment? = null - var leftOperandReplacement: Expression? = null - var rightAssignment: Assignment? = null - var rightOperandReplacement: Expression? = null - - val separateLeftExpr = !expr.left.isSimple - && expr.left !is IFunctionCall - && expr.left !is ContainmentCheck - val separateRightExpr = !expr.right.isSimple - && expr.right !is IFunctionCall - && expr.right !is ContainmentCheck val leftDt = expr.left.inferType(program) val rightDt = expr.right.inferType(program) @@ -172,6 +161,17 @@ internal class NotExpressionAndIfComparisonExprChanger(val program: Program, val return CondExprSimplificationResult(null, null, null, null) } + var leftAssignment: Assignment? = null + var leftOperandReplacement: Expression? = null + var rightAssignment: Assignment? = null + var rightOperandReplacement: Expression? = null + val separateLeftExpr = !expr.left.isSimple + && expr.left !is IFunctionCall + && expr.left !is ContainmentCheck + val separateRightExpr = !expr.right.isSimple + && expr.right !is IFunctionCall + && expr.right !is ContainmentCheck + if(separateLeftExpr) { val name = getTempRegisterName(leftDt) leftOperandReplacement = IdentifierReference(name, expr.position)