Author: Sam McCall
Date: 2020-11-29T13:40:29+01:00
New Revision: d99da80841cb4d9734db4a48cd49e37b623176bc

URL: 
https://github.com/llvm/llvm-project/commit/d99da80841cb4d9734db4a48cd49e37b623176bc
DIFF: 
https://github.com/llvm/llvm-project/commit/d99da80841cb4d9734db4a48cd49e37b623176bc.diff

LOG: [clangd] Fix path edge-case condition.

Added: 
    

Modified: 
    clang-tools-extra/clangd/ConfigProvider.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/ConfigProvider.cpp 
b/clang-tools-extra/clangd/ConfigProvider.cpp
index e020ec04d1d2..8a3991ed1c1e 100644
--- a/clang-tools-extra/clangd/ConfigProvider.cpp
+++ b/clang-tools-extra/clangd/ConfigProvider.cpp
@@ -103,7 +103,7 @@ Provider::fromAncestorRelativeYAMLFiles(llvm::StringRef 
RelPath,
            I != E; ++I) {
         // Avoid weird non-substring cases like phantom "." components.
         // In practice, Component is a substring for all "normal" ancestors.
-        if (I->end() < Parent.begin() && I->end() > Parent.end())
+        if (I->end() < Parent.begin() || I->end() > Parent.end())
           continue;
         Ancestors.emplace_back(Parent.begin(), I->end() - Parent.begin());
       }


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to