summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2018-11-22 12:54:25 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2018-11-22 12:54:25 +0000
commit2c3477596f5f8f9010fe2d5ca55764a684d9410c (patch)
treed646f0b6047a816e6dac32c51427048050970184 /clang-tools-extra/unittests
parent1cb8a3c690ab86925ab27b394b66f08a3e69fa15 (diff)
downloadbcm5719-llvm-2c3477596f5f8f9010fe2d5ca55764a684d9410c.tar.gz
bcm5719-llvm-2c3477596f5f8f9010fe2d5ca55764a684d9410c.zip
[clangd] Fix use-after-scope in unit test
The scheduler holds a reference to `Proceed`, so it has to be destroyed after the scheduler. Found by asan. llvm-svn: 347460
Diffstat (limited to 'clang-tools-extra/unittests')
-rw-r--r--clang-tools-extra/unittests/clangd/TUSchedulerTests.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang-tools-extra/unittests/clangd/TUSchedulerTests.cpp b/clang-tools-extra/unittests/clangd/TUSchedulerTests.cpp
index e7c7e450db8..e21788ee444 100644
--- a/clang-tools-extra/unittests/clangd/TUSchedulerTests.cpp
+++ b/clang-tools-extra/unittests/clangd/TUSchedulerTests.cpp
@@ -221,6 +221,7 @@ TEST_F(TUSchedulerTests, Cancellation) {
// R3 <-- cancelled
std::vector<std::string> DiagsSeen, ReadsSeen, ReadsCanceled;
{
+ Notification Proceed; // Ensure we schedule everything.
TUScheduler S(
getDefaultAsyncThreadsCount(), /*StorePreamblesInMemory=*/true,
/*ASTCallbacks=*/nullptr,
@@ -255,7 +256,6 @@ TEST_F(TUSchedulerTests, Cancellation) {
return std::move(T.second);
};
- Notification Proceed; // Ensure we schedule everything.
S.update(Path, getInputs(Path, ""), WantDiagnostics::Yes,
[&](std::vector<Diag> Diags) { Proceed.wait(); });
// The second parens indicate cancellation, where present.
OpenPOWER on IntegriCloud