Skip to content

Commit

Permalink
[clangd] Fix use-after-free in ProjectAwareIndex tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kadircet committed Nov 22, 2020
1 parent cab3136 commit 6553600
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clang-tools-extra/clangd/unittests/ProjectAwareIndexTests.cpp
Expand Up @@ -27,9 +27,9 @@ using testing::ElementsAre;
using testing::IsEmpty;

std::unique_ptr<SymbolIndex> createIndex() {
std::vector<Symbol> Symbols = {symbol("1")};
return std::make_unique<MemIndex>(std::move(Symbols), RefSlab(),
RelationSlab());
SymbolSlab::Builder Builder;
Builder.insert(symbol("1"));
return MemIndex::build(std::move(Builder).build(), RefSlab(), RelationSlab());
}

TEST(ProjectAware, Test) {
Expand Down

0 comments on commit 6553600

Please sign in to comment.