From 8c3db214b019517baa1663d7b8eadcefb0a477df Mon Sep 17 00:00:00 2001 From: Adrian Pop Date: Tue, 7 Aug 2018 00:17:53 +0200 Subject: [PATCH] fix for ticket:5054 - proper prefixing (subscript transfer) of condition in Equation.IF Belonging to [master]: - OpenModelica/OMCompiler#2591 - OpenModelica/OpenModelica-testsuite#1007 --- Compiler/NFFrontEnd/NFFlatten.mo | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Compiler/NFFrontEnd/NFFlatten.mo b/Compiler/NFFrontEnd/NFFlatten.mo index 6e99be1c406..2ea2a2a0328 100644 --- a/Compiler/NFFrontEnd/NFFlatten.mo +++ b/Compiler/NFFrontEnd/NFFlatten.mo @@ -778,6 +778,9 @@ algorithm bl := match b case Equation.Branch.BRANCH(cond, var, eql) algorithm + // flatten the condition first + cond := flattenExp(cond, prefix); + // flatten the equations eql := flattenEquations(eql, prefix); if Expression.isTrue(cond) and listEmpty(bl) then