Skip to content

Commit fbe0d19

Browse files
authored
Fix loading of subpackages in case of encryption (#7639)
* Fix loading of subpackages in case of encryption * Return the class parts
1 parent 57235fb commit fbe0d19

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

OMCompiler/Compiler/FrontEnd/ClassLoader.mo

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,10 @@ algorithm
301301
if (isSome(opt_cl)) then
302302
(class_ as Absyn.CLASS(name,pp,fp,ep,r,Absyn.PARTS(tv,ca,cp,ann,cmt),info)) = Util.getOption(opt_cl);
303303
reverseOrder = getPackageContentNames(class_, orderfile, mp_1, Error.getNumErrorMessages(), encrypted);
304-
path = AbsynUtil.joinWithinPath(within_,Absyn.IDENT(id));
305-
w2 = Absyn.WITHIN(path);
306-
cp = List.fold4(reverseOrder, loadCompletePackageFromMp2, mp_1, strategy, w2, encrypted, {});
307-
opt_cl = SOME(Absyn.CLASS(name,pp,fp,ep,r,Absyn.PARTS(tv,ca,cp,ann,cmt),info));
304+
path = AbsynUtil.joinWithinPath(within_,Absyn.IDENT(id));
305+
w2 = Absyn.WITHIN(path);
306+
cp = List.fold4(reverseOrder, loadCompletePackageFromMp2, mp_1, strategy, w2, encrypted, {});
307+
opt_cl = SOME(Absyn.CLASS(name,pp,fp,ep,r,Absyn.PARTS(tv,ca,cp,ann,cmt),info));
308308
end if;
309309
then opt_cl;
310310
case (_,pack,mp,_)
@@ -380,20 +380,20 @@ algorithm
380380
ei = AbsynUtil.makeClassElement(Util.getOption(cl));
381381
cps = mergeBefore(Absyn.PUBLIC({ei}),acc);
382382
else
383-
cps = {};
383+
cps = acc;
384384
end if;
385385
else
386386
file = mp + pd + id + (if encrypted then ".moc" else ".mo");
387387
if not System.regularFileExists(file) then
388388
Error.addInternalError("Expected file " + file + " to exist", sourceInfo());
389389
fail();
390390
end if;
391-
cl = parsePackageFile(file, strategy, false, w1, id);
391+
cl = parsePackageFile(file, strategy, false, w1, id, encrypted);
392392
if (isSome(cl)) then
393393
ei = AbsynUtil.makeClassElement(Util.getOption(cl));
394394
cps = mergeBefore(Absyn.PUBLIC({ei}),acc);
395395
else
396-
cps = {};
396+
cps = acc;
397397
end if;
398398
end if;
399399
then cps;

0 commit comments

Comments
 (0)