From 3237de3e97a73346e9ba70b4603471e354da07e0 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 4d06e7bb2cb91..dc368b03c3ed4 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); }