diff options
author | Stan Shebs <stanshebs@google.com> | 2019-10-30 13:32:13 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2021-08-27 17:26:03 -0700 |
commit | 396a77d48eb3652686bc29c28ec9cc632ad579e2 (patch) | |
tree | 977ad421aa50f45347e3c973f186230952f47176 | |
parent | 7d7724e7957ed579b173392ac2ab150d4f51e3cb (diff) | |
download | glibc-396a77d48eb3652686bc29c28ec9cc632ad579e2.tar.gz |
Remove an unneeded local refactor in _dl_update_slotinfo
-rw-r--r-- | elf/dl-tls.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/elf/dl-tls.c b/elf/dl-tls.c index 47242097fc..67198f706b 100644 --- a/elf/dl-tls.c +++ b/elf/dl-tls.c @@ -720,26 +720,25 @@ _dl_update_slotinfo (unsigned long int req_modid) if (gen <= dtv[0].counter) continue; - size_t modid = total + cnt; - /* If there is no map this means the entry is empty. */ struct link_map *map = listp->slotinfo[cnt].map; if (map == NULL) { - if (dtv[-1].counter >= modid) + if (dtv[-1].counter >= total + cnt) { /* If this modid was used at some point the memory might still be allocated. */ - __signal_safe_free (dtv[modid].pointer.to_free); - dtv[modid].pointer.val = TLS_DTV_UNALLOCATED; - dtv[modid].pointer.to_free = NULL; + __signal_safe_free (dtv[total + cnt].pointer.to_free); + dtv[total + cnt].pointer.val = TLS_DTV_UNALLOCATED; + dtv[total + cnt].pointer.to_free = NULL; } continue; } - assert (modid == map->l_tls_modid); /* Check whether the current dtv array is large enough. */ + size_t modid = map->l_tls_modid; + assert (total + cnt == modid); if (dtv[-1].counter < modid) { /* Resize the dtv. */ |