|
From: <sv...@va...> - 2009-04-26 14:42:42
|
Author: bart
Date: 2009-04-26 15:42:33 +0100 (Sun, 26 Apr 2009)
New Revision: 9639
Log:
bm_equal() now also supports comparing bitmaps where some or all of the second-level bitmaps are entirely zero.
Modified:
trunk/drd/drd_bitmap.c
Modified: trunk/drd/drd_bitmap.c
===================================================================
--- trunk/drd/drd_bitmap.c 2009-04-26 11:29:02 UTC (rev 9638)
+++ trunk/drd/drd_bitmap.c 2009-04-26 14:42:33 UTC (rev 9639)
@@ -948,15 +948,23 @@
VG_(message)(Vg_DebugMsg, "bm_equal: at 0x%lx", bm2l->addr << ADDR0_BITS);
#endif
- bm2r_ref = VG_(OSetGen_Next)(rhs->oset);
- if (bm2r_ref == 0)
+ do
{
+ bm2r_ref = VG_(OSetGen_Next)(rhs->oset);
+ if (bm2r_ref == 0)
+ {
#if 0
- VG_(message)(Vg_DebugMsg, "bm_equal: no match found");
+ VG_(message)(Vg_DebugMsg, "bm_equal: no match found");
#endif
- return False;
+ return False;
+ }
+ bm2r = bm2r_ref->bm2;
+ tl_assert(bm2r);
}
- bm2r = bm2r_ref->bm2;
+ while (! DRD_(bm_has_any_access)(rhs,
+ bm2r->addr << ADDR0_BITS,
+ (bm2r->addr + 1) << ADDR0_BITS));
+
tl_assert(bm2r);
tl_assert(DRD_(bm_has_any_access)(rhs,
bm2r->addr << ADDR0_BITS,
@@ -973,7 +981,13 @@
return False;
}
}
- bm2r = VG_(OSetGen_Next)(rhs->oset);
+
+ do
+ {
+ bm2r = VG_(OSetGen_Next)(rhs->oset);
+ } while (bm2r && ! DRD_(bm_has_any_access)(rhs,
+ bm2r->addr << ADDR0_BITS,
+ (bm2r->addr + 1) << ADDR0_BITS));
if (bm2r)
{
tl_assert(DRD_(bm_has_any_access)(rhs,
|