Record an observation about addr_is_in_MAC_Chunk().



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4796 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/mac_shared.c b/memcheck/mac_shared.c
index ec48650..fe67d04 100644
--- a/memcheck/mac_shared.c
+++ b/memcheck/mac_shared.c
@@ -413,6 +413,12 @@
 /* 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 );
 }