From 8c1b5c9ea9af2e4aa2234d313fbb4fbcf9bbf972 Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Fri, 2 Dec 2016 09:51:51 +0000 Subject: [Frontend] Fix an issue where a quoted search path is incorrectly removed as a duplicate header search path The commit r126167 started passing the First index into RemoveDuplicates, but forgot to update 0 to First in the loop that looks for the duplicate. This resulted in a bug where an -iquoted search path was incorrectly removed if you passed in the same path into -iquote and more than one time into -isystem. rdar://23991350 Differential Revision: https://reviews.llvm.org/D27298 llvm-svn: 288491 --- clang/lib/Frontend/InitHeaderSearch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Frontend/InitHeaderSearch.cpp') diff --git a/clang/lib/Frontend/InitHeaderSearch.cpp b/clang/lib/Frontend/InitHeaderSearch.cpp index c76ccea8ac3..d50fb6d788a 100644 --- a/clang/lib/Frontend/InitHeaderSearch.cpp +++ b/clang/lib/Frontend/InitHeaderSearch.cpp @@ -526,7 +526,7 @@ static unsigned RemoveDuplicates(std::vector &SearchList, if (CurEntry.getDirCharacteristic() != SrcMgr::C_User) { // Find the dir that this is the same of. unsigned FirstDir; - for (FirstDir = 0; ; ++FirstDir) { + for (FirstDir = First;; ++FirstDir) { assert(FirstDir != i && "Didn't find dupe?"); const DirectoryLookup &SearchEntry = SearchList[FirstDir]; -- cgit v1.2.3