[PATCH] D121850: [scudo][tests] Pass read-only vector by reference

Dominic Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 17 10:18:11 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6ce08d5c2786: [scudo][tests] Pass read-only vector by reference (authored by ddcc).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121850/new/

https://reviews.llvm.org/D121850

Files:
  compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
  compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp


Index: compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
===================================================================
--- compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
+++ compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
@@ -153,7 +153,7 @@
   const scudo::uptr PageSize = scudo::getPageSizeCached();
   for (scudo::uptr I = 0; I < 32U; I++)
     V.push_back(Allocator->allocate(Options, (std::rand() % 16) * PageSize));
-  auto Lambda = [V](scudo::uptr Block) {
+  auto Lambda = [&V](scudo::uptr Block) {
     EXPECT_NE(std::find(V.begin(), V.end(), reinterpret_cast<void *>(Block)),
               V.end());
   };
Index: compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
===================================================================
--- compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
+++ compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
@@ -207,7 +207,7 @@
     V.push_back(std::make_pair(ClassId, P));
   }
   scudo::uptr Found = 0;
-  auto Lambda = [V, &Found](scudo::uptr Block) {
+  auto Lambda = [&V, &Found](scudo::uptr Block) {
     for (const auto &Pair : V) {
       if (Pair.second == reinterpret_cast<void *>(Block))
         Found++;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121850.416233.patch
Type: text/x-patch
Size: 1212 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220317/c36c9154/attachment.bin>


More information about the llvm-commits mailing list