public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] libctf: fix dynset insertion
@ 2024-07-31 20:44 Nick Alcock
  0 siblings, 0 replies; only message in thread
From: Nick Alcock @ 2024-07-31 20:44 UTC (permalink / raw)
  To: binutils-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=67588c4dd687fee5164592ee2054638e53bee62f

commit 67588c4dd687fee5164592ee2054638e53bee62f
Author: Nick Alcock <nick.alcock@oracle.com>
Date:   Mon Jul 15 20:50:25 2024 +0100

    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.

Diff:
---
 libctf/ctf-hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libctf/ctf-hash.c b/libctf/ctf-hash.c
index a52f96db105..7f291e3ac27 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)
     {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-07-31 20:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-31 20:44 [binutils-gdb] libctf: fix dynset insertion Nick Alcock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).