]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fixed bug in DRD's realloc() wrapper.
authorBart Van Assche <bvanassche@acm.org>
Tue, 9 Jun 2009 11:12:07 +0000 (11:12 +0000)
committerBart Van Assche <bvanassche@acm.org>
Tue, 9 Jun 2009 11:12:07 +0000 (11:12 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10282

drd/drd_main.c
drd/drd_malloc_wrappers.c

index 4752748f8c47d2f37f155759c6fca6c993f7917d..121d4dfa787c1e8c237b22dbaa9a1a917791ef1d 100644 (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)()))
    {
index 457ca82474669f2590f4d6a9a04ed1426ccaf60d..d0109f150435b95cb0a6ded3fb86fe1f9a740e65 100644 (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;