-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip record field names with
--obfuscate=protected
(#11997)
- Don't obfuscate record field names when `--obfuscate=protected` is used, since doing so causes the names to be inconsistent with the names in the record constructors/types. Fixes #11994
- Loading branch information
Showing
3 changed files
with
63 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// name: Obfuscation5 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
setCommandLineOptions("--obfuscate=protected"); | ||
loadString(" | ||
record R | ||
Real x; | ||
Real y; | ||
end R; | ||
|
||
model M | ||
R r1; | ||
protected | ||
R r2; | ||
equation | ||
r1 = R(1, 2); | ||
r2 = R(3, 4); | ||
end M; | ||
"); | ||
|
||
instantiateModel(M); getErrorString(); | ||
|
||
// Result: | ||
// true | ||
// true | ||
// "function R \"Automatically generated record constructor for R\" | ||
// input Real x; | ||
// input Real y; | ||
// output R res; | ||
// end R; | ||
// | ||
// class M | ||
// Real r1.x; | ||
// Real r1.y; | ||
// protected Real n1.x; | ||
// protected Real n1.y; | ||
// equation | ||
// r1 = R(1.0, 2.0); | ||
// n1 = R(3.0, 4.0); | ||
// end M; | ||
// " | ||
// "" | ||
// endResult |