Skip to content

Commit 5035895

Browse files
authored
Change --obfuscate to be a string flag (#9342)
- Change --obfuscate to be a string flag instead of a string list flag, since it's only supposed to take one argument.
1 parent 7e97e71 commit 5035895

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

OMCompiler/Compiler/Script/CevalScriptBackend.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3372,7 +3372,7 @@ algorithm
33723372
(_, builtin_p) := FBuiltin.getInitialFunctions();
33733373
scode_p := SymbolTable.getSCode();
33743374

3375-
if not Flags.isConfigFlagSet(Flags.OBFUSCATE, "none") then
3375+
if not Flags.getConfigString(Flags.OBFUSCATE) == "none" then
33763376
(scode_p, cls_name, _, _, obfuscate_map) := Obfuscate.obfuscateProgram(scode_p, cls_name);
33773377
end if;
33783378

@@ -3394,7 +3394,7 @@ algorithm
33943394
fail();
33953395
end try;
33963396

3397-
if Flags.isConfigFlagSet(Flags.OBFUSCATE, "protected") then
3397+
if Flags.getConfigString(Flags.OBFUSCATE) == "protected" then
33983398
flatModel := FlatModel.deobfuscatePublicVars(flatModel, obfuscate_map);
33993399
end if;
34003400
end runFrontEndWorkNF;

OMCompiler/Compiler/Util/Flags.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,7 @@ constant ConfigFlag SIMULATION = CONFIG_FLAG(151, "simulation",
14221422
Gettext.gettext("Simulates the last model in the given Modelica file."));
14231423

14241424
constant ConfigFlag OBFUSCATE = CONFIG_FLAG(152, "obfuscate",
1425-
NONE(), EXTERNAL(), STRING_LIST_FLAG({"none"}),
1425+
NONE(), EXTERNAL(), STRING_FLAG("none"),
14261426
SOME(STRING_DESC_OPTION({
14271427
("none", Gettext.gettext("No obfuscation.")),
14281428
("protected", Gettext.gettext("Obfuscates everything except for public variables.")),

0 commit comments

Comments
 (0)