mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Do not inherit search paths from loaded binary Swift module dependencies in Swift 6
This commit is contained in:
@@ -271,8 +271,10 @@ Status ModuleFile::associateWithFileContext(FileUnit *file, SourceLoc diagLoc,
|
||||
}
|
||||
|
||||
StringRef SDKPath = ctx.SearchPathOpts.getSDKPath();
|
||||
if (SDKPath.empty() ||
|
||||
!Core->ModuleInputBuffer->getBufferIdentifier().startswith(SDKPath)) {
|
||||
// In Swift 6 mode, we do not inherit search paths from loaded non-SDK modules.
|
||||
if (!ctx.LangOpts.isSwiftVersionAtLeast(6) &&
|
||||
(SDKPath.empty() ||
|
||||
!Core->ModuleInputBuffer->getBufferIdentifier().startswith(SDKPath))) {
|
||||
for (const auto &searchPath : Core->SearchPaths) {
|
||||
ctx.addSearchPath(
|
||||
ctx.SearchPathOpts.SearchPathRemapper.remapPath(searchPath.Path),
|
||||
|
||||
Reference in New Issue
Block a user