summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-02-06 12:54:14 +0100
committerHenning Baldersheim <balder@oath.com>2018-02-06 12:54:14 +0100
commit95fe8ef70a068ed480585888f68401eda2ab5fc4 (patch)
tree59497cd01678fdaba4491ad0fb366db9a55458f9 /searchcore
parent5bcf2ebbed11f6225aa24c4ccac0482f6671fc23 (diff)
Prevent underflow due to returning endid
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp
index 4822dc57669..c1c4387cf41 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp
@@ -180,7 +180,7 @@ MatchThread::match_loop(MatchTools &tools, HitCollector &hits)
{
uint32_t lastCovered = inner_match_loop<Strategy, do_rank, do_limit, do_share_work>(context, tools, docid_range);
softDoomed = (lastCovered < docid_range.end);
- docsCovered += lastCovered - docid_range.begin;
+ docsCovered += std::min(lastCovered, docid_range.end) - docid_range.begin;
}
uint32_t matches = context.matches;
if (do_limit && context.isBelowLimit()) {