diff --git a/OMCompiler/Compiler/NFFrontEnd/NFInstNode.mo b/OMCompiler/Compiler/NFFrontEnd/NFInstNode.mo index 12c4c1beed3..bfc86b23fc8 100644 --- a/OMCompiler/Compiler/NFFrontEnd/NFInstNode.mo +++ b/OMCompiler/Compiler/NFFrontEnd/NFInstNode.mo @@ -627,11 +627,11 @@ uniontype InstNode output InstNode parent; algorithm parent := match node - case CLASS_NODE() then parent(getDerivedNode(node)); + case CLASS_NODE() then getDerivedNode(parent(getDerivedNode(node))); case COMPONENT_NODE(nodeType = InstNodeType.REDECLARED_COMP(parent = parent)) then getDerivedNode(parent); - case COMPONENT_NODE() then parent(getDerivedNode(node)); - case IMPLICIT_SCOPE() then parent(getDerivedNode(node)); + case COMPONENT_NODE() then getDerivedNode(parent(getDerivedNode(node))); + case IMPLICIT_SCOPE() then getDerivedNode(parent(getDerivedNode(node))); else EMPTY_NODE(); end match; end instanceParent; diff --git a/OMCompiler/Compiler/NFFrontEnd/NFLookup.mo b/OMCompiler/Compiler/NFFrontEnd/NFLookup.mo index 638224a79cb..a9d22e85b06 100644 --- a/OMCompiler/Compiler/NFFrontEnd/NFLookup.mo +++ b/OMCompiler/Compiler/NFFrontEnd/NFLookup.mo @@ -395,8 +395,6 @@ protected InstNode prev_scope = scope; algorithm while not InstNode.isEmpty(cur_scope) loop - cur_scope := InstNode.getDerivedNode(cur_scope); - try // Check if we have an element with the same name as the outer node in this scope. innerNode := InstNode.resolveOuter(Class.lookupElement(name, InstNode.getClass(cur_scope))); diff --git a/testsuite/openmodelica/interactive-API/Obfuscation2.mos b/testsuite/openmodelica/interactive-API/Obfuscation2.mos index 73c7385af66..4fd8b07d987 100644 --- a/testsuite/openmodelica/interactive-API/Obfuscation2.mos +++ b/testsuite/openmodelica/interactive-API/Obfuscation2.mos @@ -69,8 +69,8 @@ instantiateModel(Modelica.Fluid.Examples.BranchingDynamicPipes); getErrorString( // protected Real fb \"= f_nonlinear(b) - y_zero\"; // protected Real fc; // protected Boolean found = false; -// protected Real x_min2 = x_min - 1e-10; -// protected Real x_max2 = x_max + 1e-10; +// protected Real x_min2 = x_min - x_eps; +// protected Real x_max2 = x_max + x_eps; // protected Real a = x_min2 \"Current best minimum interval value\"; // protected Real b = x_max2 \"Current best maximum interval value\"; // algorithm @@ -100,7 +100,7 @@ instantiateModel(Modelica.Fluid.Examples.BranchingDynamicPipes); getErrorString( // fb := fc; // fc := fa; // end if; -// tol := 2.0 * 1e-15 * abs(b) + x_tol; +// tol := 2.0 * eps * abs(b) + x_tol; // m := (c - b) / 2.0; // if abs(m) <= tol or fb == 0.0 then // found := true; @@ -472,8 +472,8 @@ instantiateModel(Modelica.Fluid.Examples.BranchingDynamicPipes); getErrorString( // protected Real fb \"= f_nonlinear(b) - y_zero\"; // protected Real fc; // protected Boolean found = false; -// protected Real x_min2 = x_min - 1e-10; -// protected Real x_max2 = x_max + 1e-10; +// protected Real x_min2 = x_min - x_eps; +// protected Real x_max2 = x_max + x_eps; // protected Real a = x_min2 \"Current best minimum interval value\"; // protected Real b = x_max2 \"Current best maximum interval value\"; // algorithm @@ -503,7 +503,7 @@ instantiateModel(Modelica.Fluid.Examples.BranchingDynamicPipes); getErrorString( // fb := fc; // fc := fa; // end if; -// tol := 2.0 * 1e-15 * abs(b) + x_tol; +// tol := 2.0 * eps * abs(b) + x_tol; // m := (c - b) / 2.0; // if abs(m) <= tol or fb == 0.0 then // found := true; @@ -875,8 +875,8 @@ instantiateModel(Modelica.Fluid.Examples.BranchingDynamicPipes); getErrorString( // protected Real fb \"= f_nonlinear(b) - y_zero\"; // protected Real fc; // protected Boolean found = false; -// protected Real x_min2 = x_min - 1e-10; -// protected Real x_max2 = x_max + 1e-10; +// protected Real x_min2 = x_min - x_eps; +// protected Real x_max2 = x_max + x_eps; // protected Real a = x_min2 \"Current best minimum interval value\"; // protected Real b = x_max2 \"Current best maximum interval value\"; // algorithm @@ -906,7 +906,7 @@ instantiateModel(Modelica.Fluid.Examples.BranchingDynamicPipes); getErrorString( // fb := fc; // fc := fa; // end if; -// tol := 2.0 * 1e-15 * abs(b) + x_tol; +// tol := 2.0 * eps * abs(b) + x_tol; // m := (c - b) / 2.0; // if abs(m) <= tol or fb == 0.0 then // found := true; @@ -1518,8 +1518,8 @@ instantiateModel(Modelica.Fluid.Examples.BranchingDynamicPipes); getErrorString( // protected Real fb \"= f_nonlinear(b) - y_zero\"; // protected Real fc; // protected Boolean found = false; -// protected Real x_min2 = x_min - 1e-10; -// protected Real x_max2 = x_max + 1e-10; +// protected Real x_min2 = x_min - x_eps; +// protected Real x_max2 = x_max + x_eps; // protected Real a = x_min2 \"Current best minimum interval value\"; // protected Real b = x_max2 \"Current best maximum interval value\"; // algorithm @@ -1549,7 +1549,7 @@ instantiateModel(Modelica.Fluid.Examples.BranchingDynamicPipes); getErrorString( // fb := fc; // fc := fa; // end if; -// tol := 2.0 * 1e-15 * abs(b) + x_tol; +// tol := 2.0 * eps * abs(b) + x_tol; // m := (c - b) / 2.0; // if abs(m) <= tol or fb == 0.0 then // found := true; @@ -2381,8 +2381,8 @@ instantiateModel(Modelica.Fluid.Examples.BranchingDynamicPipes); getErrorString( // protected Real fb \"= f_nonlinear(b) - y_zero\"; // protected Real fc; // protected Boolean found = false; -// protected Real x_min2 = x_min - 1e-10; -// protected Real x_max2 = x_max + 1e-10; +// protected Real x_min2 = x_min - x_eps; +// protected Real x_max2 = x_max + x_eps; // protected Real a = x_min2 \"Current best minimum interval value\"; // protected Real b = x_max2 \"Current best maximum interval value\"; // algorithm @@ -2412,7 +2412,7 @@ instantiateModel(Modelica.Fluid.Examples.BranchingDynamicPipes); getErrorString( // fb := fc; // fc := fa; // end if; -// tol := 2.0 * 1e-15 * abs(b) + x_tol; +// tol := 2.0 * eps * abs(b) + x_tol; // m := (c - b) / 2.0; // if abs(m) <= tol or fb == 0.0 then // found := true; @@ -3024,8 +3024,8 @@ instantiateModel(Modelica.Fluid.Examples.BranchingDynamicPipes); getErrorString( // protected Real fb \"= f_nonlinear(b) - y_zero\"; // protected Real fc; // protected Boolean found = false; -// protected Real x_min2 = x_min - 1e-10; -// protected Real x_max2 = x_max + 1e-10; +// protected Real x_min2 = x_min - x_eps; +// protected Real x_max2 = x_max + x_eps; // protected Real a = x_min2 \"Current best minimum interval value\"; // protected Real b = x_max2 \"Current best maximum interval value\"; // algorithm @@ -3055,7 +3055,7 @@ instantiateModel(Modelica.Fluid.Examples.BranchingDynamicPipes); getErrorString( // fb := fc; // fc := fa; // end if; -// tol := 2.0 * 1e-15 * abs(b) + x_tol; +// tol := 2.0 * eps * abs(b) + x_tol; // m := (c - b) / 2.0; // if abs(m) <= tol or fb == 0.0 then // found := true;