]> sourceware.org Git - glibc.git/commitdiff
malloc: Simplify __mtag_tag_new_usable
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 4 Feb 2021 11:38:23 +0000 (11:38 +0000)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 19 Mar 2021 11:46:20 +0000 (11:46 +0000)
The chunk cannot be a dumped one here.  The only non-obvious cases
are free and realloc which may be called on a dumped area chunk,
but in both cases it can be verified that tagging is already
avoided for dumped area chunks.

Reviewed-by: DJ Delorie <dj@redhat.com>
malloc/arena.c

index bf17be27d48c7a39fc3b421957cb020a4451cc50..0777dc70c6906a33e74fd752680c013febcce0d7 100644 (file)
@@ -298,11 +298,6 @@ __mtag_tag_new_usable (void *ptr)
   if (ptr)
     {
       mchunkptr cp = mem2chunk(ptr);
-      /* This likely will never happen, but we can't handle retagging
-        chunks from the dumped main arena.  So just return the
-        existing pointer.  */
-      if (DUMPED_MAIN_ARENA_CHUNK (cp))
-       return ptr;
       ptr = __libc_mtag_tag_region (__libc_mtag_new_tag (ptr),
                                    CHUNK_AVAILABLE_SIZE (cp) - CHUNK_HDR_SZ);
     }
This page took 0.044987 seconds and 5 git commands to generate.