Do not prefix relative SDK paths twice

This commit is contained in:
Richard Howell
2024-09-20 15:18:30 -07:00
parent 3c5d410426
commit a04ddefb10
7 changed files with 49 additions and 1 deletions

View File

@@ -1798,7 +1798,7 @@ bool ModuleFileSharedCore::hasSourceInfo() const {
std::string ModuleFileSharedCore::resolveModuleDefiningFilePath(const StringRef SDKPath) const {
if (!ModuleInterfacePath.empty()) {
std::string interfacePath = ModuleInterfacePath.str();
if (llvm::sys::path::is_relative(interfacePath)) {
if (llvm::sys::path::is_relative(interfacePath) && !ModuleInterfacePath.starts_with(SDKPath)) {
SmallString<128> absoluteInterfacePath(SDKPath);
llvm::sys::path::append(absoluteInterfacePath, interfacePath);
return absoluteInterfacePath.str().str();