Skip to content

Commit d6c6bdc

Browse files
committed
[llvm][cas] Fix stack-use-after-scope OnDiskCASLoggerTest
We were unintentionally capturing the loop induction variable I as a reference instead of a copy. Caught by asan. (cherry picked from commit ce6efb2) rdar://147936276
1 parent d2ed2d2 commit d6c6bdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/unittests/CAS/OnDiskCASLoggerTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ TEST(OnDiskCASLoggerTest, MultiThread) {
106106
Succeeded());
107107

108108
for (int I = 0; I < 10; ++I) {
109-
Pool.async([&] {
109+
Pool.async([I, &SharedLogger, &Dir] {
110110
std::unique_ptr<OnDiskCASLogger> OwnedLogger;
111111
OnDiskCASLogger *Logger;
112112
// Mix using a shared instance and opening new instances in the same log.

0 commit comments

Comments
 (0)