Skip to content

Commit

Permalink
Fix FlatModel.obfuscateCref (#11991)
Browse files Browse the repository at this point in the history
- Make `FlatModel.obfuscateCref` recursive so the whole cref is
  obfuscated and not only the last part.
  • Loading branch information
perost committed Feb 15, 2024
1 parent 88df1b7 commit 4f5176c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions OMCompiler/Compiler/NFFrontEnd/NFFlatModel.mo
Expand Up @@ -767,6 +767,7 @@ public
cref.subscripts := list(Subscript.mapShallowExp(s,
function obfuscateExp(obfuscationMap = obfuscationMap)) for s in cref.subscripts);
cref.restCref := obfuscateCref(cref.restCref, obfuscationMap);
then
();
Expand Down
13 changes: 7 additions & 6 deletions testsuite/openmodelica/interactive-API/Obfuscation3.mos
Expand Up @@ -38,6 +38,7 @@ loadString("
model M
P1.A a1;
P2.A a2;
protected
P2.B b1;
P2.C c1;
end M;
Expand All @@ -51,12 +52,12 @@ instantiateModel(M); getErrorString();
// "class M
// Real a1.x;
// Real a2.x \"x2\";
// Real b1.y \"y\";
// protected Real b1.n1;
// Real c1.y \"y\";
// protected Real c1.n2;
// Real c1.w \"w\";
// protected Real c1.n3 \"u\";
// protected Real n1.n2;
// protected Real n1.n3;
// protected Real n4.n5;
// protected Real n4.n6;
// protected Real n4.n7 \"w\";
// protected Real n4.n8 \"u\";
// end M;
// "
// ""
Expand Down

0 comments on commit 4f5176c

Please sign in to comment.