|
From: <sv...@va...> - 2005-09-27 20:51:23
|
Author: njn
Date: 2005-09-27 21:51:12 +0100 (Tue, 27 Sep 2005)
New Revision: 4796
Log:
Record an observation about addr_is_in_MAC_Chunk().
Modified:
trunk/memcheck/mac_shared.c
Modified: trunk/memcheck/mac_shared.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/mac_shared.c 2005-09-27 20:28:00 UTC (rev 4795)
+++ trunk/memcheck/mac_shared.c 2005-09-27 20:51:12 UTC (rev 4796)
@@ -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 );
}
|