From: Nicholas Nethercote Date: Tue, 27 Sep 2005 20:51:12 +0000 (+0000) Subject: Record an observation about addr_is_in_MAC_Chunk(). X-Git-Tag: svn/VALGRIND_3_1_0~432 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=01ace453bb1746f01ffb339eb31ab5676a2186c0;p=thirdparty%2Fvalgrind.git Record an observation about addr_is_in_MAC_Chunk(). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4796 --- diff --git a/memcheck/mac_shared.c b/memcheck/mac_shared.c index ec48650267..fe67d040ea 100644 --- a/memcheck/mac_shared.c +++ b/memcheck/mac_shared.c @@ -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 ); }