The upperBound functions returns the first region beyond the region
containing the given address. So, to correctly use it here, we must
give it the last valid address of the current range, which is just
less than (address + size).
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
#ifndef NDEBUG
RegionMap::iterator start = lowerBound(address);
- RegionMap::iterator stop = upperBound(address + size);
+ RegionMap::iterator stop = upperBound(address + size - 1);
if (0) {
// Forget all regions that intersect this new one.
regionMap.erase(start, stop);