aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/attribute/postinglist
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@yahooinc.com>2022-06-21 11:26:58 +0000
committerHåvard Pettersen <havardpe@yahooinc.com>2022-06-21 14:15:01 +0000
commit60e28dcd0b4c1ea9eff2e4f26da7ec53ed24e64a (patch)
tree80a479d5f62a8bb7c5ce52a5d531a434075cfe57 /searchlib/src/tests/attribute/postinglist
parent1f9c4d5b83b314785cd9c83bbecec21cb00b192b (diff)
avoid nullptr deref
Diffstat (limited to 'searchlib/src/tests/attribute/postinglist')
-rw-r--r--searchlib/src/tests/attribute/postinglist/postinglist.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/searchlib/src/tests/attribute/postinglist/postinglist.cpp b/searchlib/src/tests/attribute/postinglist/postinglist.cpp
index 446aeaf22a7..54efb3261c8 100644
--- a/searchlib/src/tests/attribute/postinglist/postinglist.cpp
+++ b/searchlib/src/tests/attribute/postinglist/postinglist.cpp
@@ -379,8 +379,8 @@ insertRandomValues(Tree &tree,
std::vector<AttributePosting> additions;
std::vector<uint32_t> removals;
additions.push_back(newPosting);
- postings.apply(newIdx, &additions[0], &additions[0] + additions.size(),
- &removals[0], &removals[0] + removals.size());
+ postings.apply(newIdx, additions.data(), additions.data() + additions.size(),
+ removals.data(), removals.data() + removals.size());
std::atomic_thread_fence(std::memory_order_release);
itr.writeData(newIdx);
@@ -461,8 +461,8 @@ removeRandomValues(Tree &tree,
std::vector<AttributePosting> additions;
std::vector<uint32_t> removals;
removals.push_back(i->_docId);
- postings.apply(newIdx, &additions[0], &additions[0]+additions.size(),
- &removals[0], &removals[0] + removals.size());
+ postings.apply(newIdx, additions.data(), additions.data() + additions.size(),
+ removals.data(), removals.data() + removals.size());
if (newIdx != oldIdx) {
std::atomic_thread_fence(std::memory_order_release);
itr.writeData(newIdx);