Skip to content

Commit

Permalink
Generate legal names when obfuscating (#10522)
Browse files Browse the repository at this point in the history
Fixes #10513
  • Loading branch information
perost committed Apr 11, 2023
1 parent 0807f0f commit 1cf1bc7
Show file tree
Hide file tree
Showing 4 changed files with 3,897 additions and 3,902 deletions.
2 changes: 1 addition & 1 deletion OMCompiler/Compiler/NFFrontEnd/NFFlatModel.mo
Expand Up @@ -730,7 +730,7 @@ public
nodes := List.trim(nodes, InstNode.isPublic);
for node in nodes loop
UnorderedMap.tryAdd(node, "$n" + String(UnorderedMap.size(obfuscationMap) + 1), obfuscationMap);
UnorderedMap.tryAdd(node, "n" + String(UnorderedMap.size(obfuscationMap) + 1), obfuscationMap);
end for;
end if;
end addObfuscatedVariable;
Expand Down
7 changes: 1 addition & 6 deletions OMCompiler/Compiler/Script/Obfuscate.mo
Expand Up @@ -32,7 +32,6 @@
encapsulated package Obfuscate
import Absyn;
import AbsynUtil;
import DAE;
import Dump;
import FBuiltin;
import SCode;
Expand Down Expand Up @@ -489,7 +488,7 @@ encapsulated package Obfuscate
if isSome(oldId) then
SOME(id) := oldId;
else
id := "$n" + String(index);
id := "n" + String(index);
end if;
end makeId;

Expand Down Expand Up @@ -1016,9 +1015,5 @@ encapsulated package Obfuscate
res := ety == ElementType.FUNCTION or ety == ElementType.TYPE_AND_FUNCTION;
end isBuiltinCall;

function deobfuscatePublicDAEVars

end deobfuscatePublicDAEVars;

annotation(__OpenModelica_Interface="backend");
end Obfuscate;

0 comments on commit 1cf1bc7

Please sign in to comment.