]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
merge 5366/67/70 from trunk to fix AshleyP's custom-allocator assertion
authorDirk Mueller <daywalker@users.sourceforge.net>
Mon, 2 Jan 2006 20:44:14 +0000 (20:44 +0000)
committerDirk Mueller <daywalker@users.sourceforge.net>
Mon, 2 Jan 2006 20:44:14 +0000 (20:44 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_1_BRANCH@5480

memcheck/mac_leakcheck.c

index ce2f33fd30c5cb0e52279d24daa7554f0dbfeffd..f6fae085598e778a714b60b1f78fea7fc9723192 100644 (file)
@@ -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) {