From 40bd6eb7ee42ab10a3d0c78a4ad9b3170b94d666 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Wed, 10 Oct 2012 16:23:25 +0100 Subject: [PATCH] Add a few more assertions. --- retrace/retrace_swizzle.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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; } -- 2.43.0