From eee9331d97c348c87e8ae52901c7f0c3309d9a39 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 3 Aug 2023 10:56:50 -0700 Subject: [PATCH] ClangImporter: correct a duplicated path component When computing the path for a non-architecture specific resource, we would append the architecture unconditionally if `-sdk` is used. This would result in the path being miscomputed with the architecture or the architecture duplicated if it was architecture specific. Found by inspection. --- lib/ClangImporter/ClangIncludePaths.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ClangImporter/ClangIncludePaths.cpp b/lib/ClangImporter/ClangIncludePaths.cpp index 697c53b91c16b..313af3145b2ae 100644 --- a/lib/ClangImporter/ClangIncludePaths.cpp +++ b/lib/ClangImporter/ClangIncludePaths.cpp @@ -38,7 +38,7 @@ static llvm::Optional getActualModuleMapPath( if (!SDKPath.empty()) { result.append(SDKPath.begin(), SDKPath.end()); llvm::sys::path::append(result, "usr", "lib", "swift"); - llvm::sys::path::append(result, platform, arch); + llvm::sys::path::append(result, platform); if (isArchSpecific) { llvm::sys::path::append(result, arch); }