Skip to content

Commit 8aadcf4

Browse files
committed
[Serialization] Do not accept packages without a name
Realign the module loading behavior with the one of the package access-level. If the package name is an empty string, don't accept other modules with an empty package name as being part of the same module and don't load package dependencies in such a case.
1 parent fa58280 commit 8aadcf4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Serialization/ModuleFileSharedCore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,7 @@ ModuleFileSharedCore::getTransitiveLoadingBehavior(
17121712
if (dependency.isPackageOnly()) {
17131713
// Package dependencies are usually loaded only for import from the same
17141714
// package.
1715-
if (packageName == getModulePackageName()) {
1715+
if (!packageName.empty() && packageName == getModulePackageName()) {
17161716
return ModuleLoadingBehavior::Required;
17171717
} else if (debuggerMode) {
17181718
return ModuleLoadingBehavior::Optional;

0 commit comments

Comments
 (0)