]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Record an observation about addr_is_in_MAC_Chunk().
authorNicholas Nethercote <njn@valgrind.org>
Tue, 27 Sep 2005 20:51:12 +0000 (20:51 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Tue, 27 Sep 2005 20:51:12 +0000 (20:51 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4796

memcheck/mac_shared.c

index ec486502674281b7ceb89f4b8e9a5a18c9fe82c6..fe67d040eaa9326407c7fa3f16f5825f43443bb0 100644 (file)
@@ -413,6 +413,12 @@ Bool (*MAC_(describe_addr_supp)) ( Addr a, AddrInfo* ai ) = NULL;
 /* Function used when searching MAC_Chunk lists */
 static Bool addr_is_in_MAC_Chunk(MAC_Chunk* mc, Addr a)
 {
+   // Nb: this is not quite right!  It assumes that the heap block has
+   // a redzone of size MAC_MALLOC_REDZONE_SZB.  That's true for malloc'd
+   // blocks, but not necessarily true for custom-alloc'd blocks.  So
+   // in some cases this could result in an incorrect description (eg.
+   // saying "12 bytes after block A" when really it's within block B.
+   // Fixing would require adding redzone size to MAC_Chunks, though.
    return VG_(addr_is_in_block)( a, mc->data, mc->size,
                                  MAC_MALLOC_REDZONE_SZB );
 }