From: Bart Van Assche Date: Tue, 9 Jun 2009 11:12:07 +0000 (+0000) Subject: Fixed bug in DRD's realloc() wrapper. X-Git-Tag: svn/VALGRIND_3_5_0~515 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4443ebc0aa660dd39f62c15df293efcb985ecfe;p=thirdparty%2Fvalgrind.git Fixed bug in DRD's realloc() wrapper. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10282 --- diff --git a/drd/drd_main.c b/drd/drd_main.c index 4752748f8c..121d4dfa78 100644 --- a/drd/drd_main.c +++ b/drd/drd_main.c @@ -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)())) { diff --git a/drd/drd_malloc_wrappers.c b/drd/drd_malloc_wrappers.c index 457ca82474..d0109f1504 100644 --- a/drd/drd_malloc_wrappers.c +++ b/drd/drd_malloc_wrappers.c @@ -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;