Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 1257694

Browse files
adeas31OpenModelica-Hudson
authored andcommitted
listFile should work for Access.nonPackageText and higher
Belonging to [master]: - #2543
1 parent 75c94ec commit 1257694

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Compiler/Script/CevalScript.mo

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ algorithm
590590
Boolean new_inst;
591591
SymbolTable interactiveSymbolTable, interactiveSymbolTable2;
592592
GC.ProfStats gcStats;
593+
Absyn.Restriction restriction;
593594

594595
case (cache,_,"parseString",{Values.STRING(str1),Values.STRING(str2)},_)
595596
equation
@@ -788,8 +789,11 @@ algorithm
788789
end match;
789790
// handle encryption
790791
Values.ENUM_LITERAL(index=access) = Interactive.checkAccessAnnotationAndEncryption(path, SymbolTable.getAbsyn());
791-
if (access >= 9) then // i.e., The class is not encrypted.
792-
(absynClass as Absyn.CLASS(info=SOURCEINFO(fileName=str))) = Interactive.getPathedClassInProgram(className, SymbolTable.getAbsyn());
792+
(absynClass as Absyn.CLASS(restriction=restriction, info=SOURCEINFO(fileName=str))) = Interactive.getPathedClassInProgram(className, SymbolTable.getAbsyn());
793+
/* If the class has Access.packageText annotation or higher
794+
* If the class has Access.nonPackageText annotation or higher and class is not a package
795+
*/
796+
if ((access >= 7) or ((access >= 5) and not Absyn.isPackageRestriction(restriction))) then
793797
str = Dump.unparseStr(Absyn.PROGRAM({absynClass}, match path case Absyn.IDENT() then Absyn.TOP(); else Absyn.WITHIN(Absyn.stripLast(path)); end match), options=Dump.DUMPOPTIONS(str));
794798
else
795799
Error.addMessage(Error.ACCESS_ENCRYPTED_PROTECTED_CONTENTS, {});

0 commit comments

Comments
 (0)