From: Dirk Mueller Date: Mon, 2 Jan 2006 20:44:14 +0000 (+0000) Subject: merge 5366/67/70 from trunk to fix AshleyP's custom-allocator assertion X-Git-Tag: svn/VALGRIND_3_1_1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30f211851ce27709435b8360e3ba790508cd1f4d;p=thirdparty%2Fvalgrind.git merge 5366/67/70 from trunk to fix AshleyP's custom-allocator assertion git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_1_BRANCH@5480 --- diff --git a/memcheck/mac_leakcheck.c b/memcheck/mac_leakcheck.c index ce2f33fd30..f6fae08559 100644 --- a/memcheck/mac_leakcheck.c +++ b/memcheck/mac_leakcheck.c @@ -119,10 +119,10 @@ static Addr* get_seg_starts ( /*OUT*/Int* n_acquired ) */ typedef enum { - Unreached, - IndirectLeak, - Interior, - Proper + Unreached =0, + IndirectLeak =1, + Interior =2, + Proper =3 } Reachedness; @@ -536,7 +536,17 @@ static void full_report(ThreadId tid) lc_do_leakcheck(i); tl_assert(lc_markstack_top == -1); - tl_assert(lc_markstack[i].state == IndirectLeak); + tl_assert(lc_markstack[i].state == IndirectLeak + /* jrs 20051218: Ashley Pittman supplied a + custom-allocator test program which causes the == + 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 == Unreached); lc_markstack[i].state = Unreached; /* Return to unreached state, to indicate its a clique @@ -702,7 +712,7 @@ void MAC_(do_detect_memory_leaks) ( /* Sanity check -- make sure they don't overlap */ for (i = 0; i < lc_n_shadows-1; i++) { tl_assert( lc_shadows[i]->data + lc_shadows[i]->size - < lc_shadows[i+1]->data ); + <= lc_shadows[i+1]->data ); } if (lc_n_shadows == 0) {