summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2017-12-14 12:31:04 +0000
committerEric Liu <ioeric@google.com>2017-12-14 12:31:04 +0000
commitbcbc12972f3135d19d8401ec2b995a5d0e9f923b (patch)
treecde178c11f54b7e516af78a66f1de6088a0d4c4a
parent04fa78d7de2a215b43a945e966a9b50203e5c1c1 (diff)
[clangd] Fix a potential use-after-move bug.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@320695 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--unittests/clangd/IndexTests.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/unittests/clangd/IndexTests.cpp b/unittests/clangd/IndexTests.cpp
index 15e5f262..e94d2127 100644
--- a/unittests/clangd/IndexTests.cpp
+++ b/unittests/clangd/IndexTests.cpp
@@ -48,7 +48,8 @@ generateNumSymbols(int Begin, int End,
for (const auto &Sym : Slab->Slab)
Slab->Pointers.push_back(&Sym.second);
- return {std::move(Slab), &Slab->Pointers};
+ auto *Pointers = &Slab->Pointers;
+ return {std::move(Slab), Pointers};
}
std::vector<std::string> match(const SymbolIndex &I,