Skip to content

Commit

Permalink
Fix regressions from #10675 (#10677)
Browse files Browse the repository at this point in the history
  • Loading branch information
perost committed May 11, 2023
1 parent 949bcee commit 9f0c21d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
6 changes: 3 additions & 3 deletions OMCompiler/Compiler/NFFrontEnd/NFInstNode.mo
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions OMCompiler/Compiler/NFFrontEnd/NFLookup.mo
Expand Up @@ -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)));
Expand Down
36 changes: 18 additions & 18 deletions testsuite/openmodelica/interactive-API/Obfuscation2.mos
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9f0c21d

Please sign in to comment.