[clang-tools-extra] 4470b8c - [clangd] Fix assertions for D83826

Kirill Bobyrev via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 21 02:21:09 PDT 2020


Author: Kirill Bobyrev
Date: 2020-07-21T11:20:31+02:00
New Revision: 4470b8c6a6b16de3b4f1f3c4cf81137a9fe4c8a1

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

LOG: [clangd] Fix assertions for D83826

FuzzyFindRequest's toProtobuf is called on the client side (hence
LocalIndexRoot must be present) and fromProtobuf - on the server.

Added: 
    

Modified: 
    clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp b/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp
index 059c42ee0eaa..e8393d17b01e 100644
--- a/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp
+++ b/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp
@@ -51,7 +51,7 @@ Marshaller::Marshaller(llvm::StringRef RemoteIndexRoot,
 
 clangd::FuzzyFindRequest
 Marshaller::fromProtobuf(const FuzzyFindRequest *Request) {
-  assert(LocalIndexRoot);
+  assert(RemoteIndexRoot);
   clangd::FuzzyFindRequest Result;
   Result.Query = Request->query();
   for (const auto &Scope : Request->scopes())
@@ -146,7 +146,7 @@ LookupRequest Marshaller::toProtobuf(const clangd::LookupRequest &From) {
 }
 
 FuzzyFindRequest Marshaller::toProtobuf(const clangd::FuzzyFindRequest &From) {
-  assert(RemoteIndexRoot);
+  assert(LocalIndexRoot);
   FuzzyFindRequest RPCRequest;
   RPCRequest.set_query(From.Query);
   for (const auto &Scope : From.Scopes)


        


More information about the cfe-commits mailing list