|
From: <sv...@va...> - 2005-12-19 19:26:46
|
Author: njn
Date: 2005-12-19 19:26:40 +0000 (Mon, 19 Dec 2005)
New Revision: 5377
Log:
Merge in r5366/6377/5370 from trunk, which fix minor leak checker bugs.
Modified:
branches/COMPVBITS/memcheck/mc_leakcheck.c
Modified: branches/COMPVBITS/memcheck/mc_leakcheck.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/COMPVBITS/memcheck/mc_leakcheck.c 2005-12-19 19:15:04 UTC (r=
ev 5376)
+++ branches/COMPVBITS/memcheck/mc_leakcheck.c 2005-12-19 19:26:40 UTC (r=
ev 5377)
@@ -116,10 +116,10 @@
*/
typedef=20
enum {=20
- Unreached,=20
- IndirectLeak,
- Interior,=20
- Proper
+ Unreached =3D0,=20
+ IndirectLeak =3D1,
+ Interior =3D2,=20
+ Proper =3D3
}
Reachedness;
=20
@@ -533,7 +533,17 @@
lc_do_leakcheck(i);
=20
tl_assert(lc_markstack_top =3D=3D -1);
- tl_assert(lc_markstack[i].state =3D=3D IndirectLeak);
+ tl_assert(lc_markstack[i].state =3D=3D IndirectLeak
+ /* jrs 20051218: Ashley Pittman supplied a
+ custom-allocator test program which causes the =3D=3D
+ IndirectLeak condition to fail - it causes .state
+ to be Unreached. Since I have no idea how this
+ clique stuff works and no time to figure it out,
+ just allow that condition too. This could well be
+ a completely bogus fix. It doesn't seem unsafe
+ given that in any case the .state field is
+ immediately overwritten by the next statement. */
+ || lc_markstack[i].state =3D=3D Unreached);
=20
lc_markstack[i].state =3D Unreached; /* Return to unreached state,
to indicate its a clique
@@ -694,14 +704,14 @@
/* Sanity check -- make sure they don't overlap */
for (i =3D 0; i < lc_n_shadows-1; i++) {
tl_assert( lc_shadows[i]->data + lc_shadows[i]->size
- < lc_shadows[i+1]->data );
+ <=3D lc_shadows[i+1]->data );
}
=20
if (lc_n_shadows =3D=3D 0) {
tl_assert(lc_shadows =3D=3D NULL);
if (VG_(clo_verbosity) >=3D 1 && !VG_(clo_xml)) {
VG_(message)(Vg_UserMsg,=20
- "No malloc'd blocks -- no leaks are possible.");
+ "All heap blocks were freed -- no leaks are possib=
le.");
}
return;
}
|