forked from OSchip/llvm-project
[scudo][tests] Pass read-only vector by reference
Differential Revision: https://reviews.llvm.org/D121850
This commit is contained in:
parent
03e82d94fc
commit
6ce08d5c27
|
@ -207,7 +207,7 @@ SCUDO_TYPED_TEST(ScudoPrimaryTest, PrimaryIterate) {
|
|||
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++;
|
||||
|
|
|
@ -153,7 +153,7 @@ TEST_F(MapAllocatorTest, SecondaryIterate) {
|
|||
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());
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue