From 4470b8c6a6b16de3b4f1f3c4cf81137a9fe4c8a1 Mon Sep 17 00:00:00 2001 From: Kirill Bobyrev Date: Tue, 21 Jul 2020 11:16:43 +0200 Subject: [PATCH] [clangd] Fix assertions for D83826 FuzzyFindRequest's toProtobuf is called on the client side (hence LocalIndexRoot must be present) and fromProtobuf - on the server. --- clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp b/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp index 059c42e..e8393d1 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) -- 2.7.4