Fixed bug in DRD's realloc() wrapper.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10282
This commit is contained in:
Bart Van Assche 2009-06-09 11:12:07 +00:00
parent a4a24f0c4f
commit b4443ebc0a
2 changed files with 2 additions and 2 deletions

View File

@ -318,7 +318,7 @@ void drd_stop_using_mem(const Addr a1, const SizeT len,
{
const Addr a2 = a1 + len;
tl_assert(a1 < a2);
tl_assert(a1 <= a2);
if (UNLIKELY(DRD_(any_address_is_traced)()))
{

View File

@ -198,7 +198,7 @@ static void* DRD_(realloc)(ThreadId tid, void* p_old, SizeT new_size)
else if (old_size > new_size)
{
/* new size is smaller */
s_stop_using_mem_callback(mc->data + new_size, old_size);
s_stop_using_mem_callback(mc->data + new_size, old_size - new_size);
mc->size = new_size;
mc->where = VG_(record_ExeContext)(tid, 0);
p_new = p_old;