aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2024-07-15 20:50:25 +0100
committerNick Alcock <nick.alcock@oracle.com>2024-08-01 14:30:21 +0100
commit348059dc516a0e54fc1d88af43c9e5e1e6c0c6aa (patch)
treede52d889ec6c6d0b6d375b229e2a322a6ebee8f3
parenteee0da087b0915479f3fc8db8c5e656ca50f1ad0 (diff)
downloadgdb-348059dc516a0e54fc1d88af43c9e5e1e6c0c6aa.zip
gdb-348059dc516a0e54fc1d88af43c9e5e1e6c0c6aa.tar.gz
gdb-348059dc516a0e54fc1d88af43c9e5e1e6c0c6aa.tar.bz2
libctf: fix dynset insertion
libctf's dynsets are a straight wrapper around libiberty hashtab, storing the key directly in the hashtab slot. However, we'd often like to be able to store 0 and 1 (HTAB_EMPTY_ENTRY and HTAB_DELETED_ENTRY) in there, so we move them out of the way and replace them with huge unlikely values instead. Unfortunately we failed to do this replacement in one place, so insertion of 0 or 1 ended up misinforming the hashtab machinery that an entry was empty or deleted when it wasn't. libctf/ * ctf-hash.c (ctf_dynset_insert): Call key_to_internal properly.
-rw-r--r--libctf/ctf-hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libctf/ctf-hash.c b/libctf/ctf-hash.c
index a52f96d..7f291e3 100644
--- a/libctf/ctf-hash.c
+++ b/libctf/ctf-hash.c
@@ -626,7 +626,7 @@ ctf_dynset_insert (ctf_dynset_t *hp, void *key)
struct htab *htab = (struct htab *) hp;
void **slot;
- slot = htab_find_slot (htab, key, INSERT);
+ slot = htab_find_slot (htab, key_to_internal (key), INSERT);
if (!slot)
{