From: José Fonseca Date: Wed, 10 Oct 2012 15:23:25 +0000 (+0100) Subject: Add a few more assertions. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=40bd6eb7ee42ab10a3d0c78a4ad9b3170b94d666;p=apitrace Add a few more assertions. --- diff --git a/retrace/retrace_swizzle.cpp b/retrace/retrace_swizzle.cpp index 693fdfe..a7e777d 100644 --- a/retrace/retrace_swizzle.cpp +++ b/retrace/retrace_swizzle.cpp @@ -75,6 +75,12 @@ lowerBound(unsigned long long address) { } } +#ifndef NDEBUG + if (it != regionMap.end()) { + assert(contains(it, address) || it->first > address); + } +#endif + return it; } @@ -83,6 +89,12 @@ static RegionMap::iterator upperBound(unsigned long long address) { RegionMap::iterator it = regionMap.upper_bound(address); +#ifndef NDEBUG + if (it != regionMap.end()) { + assert(it->first >= address); + } +#endif + return it; }