Currently when checking if resilience check can be bypassed within a package,

we only check if the loaded module is built from a package interface. This is
not enough as a binary module could just contain exportable decls if built with
experimental-skip-non-exportable-decls, essentially resulting in content equivalent
to interface content. This might be made a default behavior so this PR requires
a module to opt in to allow non-resilient access by a participating client in the
same package.

Since it affects module format, SWIFTMODULE_VERSION_MINOR is updated.

rdar://123651270
This commit is contained in:
Ellie Shin
2024-02-22 18:10:07 -08:00
parent 70cf5d4783
commit 30669fca65
19 changed files with 158 additions and 15 deletions

View File

@@ -918,6 +918,8 @@ LoadedFile *SerializedModuleLoaderBase::loadAST(
M.setHasIncrementalInfo();
if (loadedModuleFile->isBuiltFromInterface())
M.setIsBuiltFromInterface();
if (loadedModuleFile->allowNonResilientAccess())
M.setAllowNonResilientAccess();
if (!loadedModuleFile->getModuleABIName().empty())
M.setABIName(Ctx.getIdentifier(loadedModuleFile->getModuleABIName()));
if (loadedModuleFile->isConcurrencyChecked())