]> git.cworth.org Git - apitrace/commitdiff
Add a few more assertions.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 10 Oct 2012 15:23:25 +0000 (16:23 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 10 Oct 2012 15:23:25 +0000 (16:23 +0100)
retrace/retrace_swizzle.cpp

index 693fdfeb375a5bbd9fd315801a3717ca973d3db8..a7e777d45cba26e8da0abe4a6bf92900a1db5162 100644 (file)
@@ -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;
 }
 
     return it;
 }
 
@@ -83,6 +89,12 @@ static RegionMap::iterator
 upperBound(unsigned long long address) {
     RegionMap::iterator it = regionMap.upper_bound(address);
 
 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;
 }
 
     return it;
 }