public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] hash-map: reject empty-looking insertions
@ 2022-12-23  5:27 Alexandre Oliva
  0 siblings, 0 replies; 4+ messages in thread
From: Alexandre Oliva @ 2022-12-23  5:27 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:e730e22ec8b6d18f00dcef3e9f8ca3e2562b8be4

commit e730e22ec8b6d18f00dcef3e9f8ca3e2562b8be4
Author: Alexandre Oliva <oliva@gnu.org>
Date:   Thu Dec 22 21:28:49 2022 -0300

    hash-map: reject empty-looking insertions

Diff:
---
 gcc/hash-map.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/hash-map.h b/gcc/hash-map.h
index 457967f4bf1..63fa21cf37c 100644
--- a/gcc/hash-map.h
+++ b/gcc/hash-map.h
@@ -169,11 +169,12 @@ public:
     {
       hash_entry *e = m_table.find_slot_with_hash (k, Traits::hash (k),
 						   INSERT);
-      bool ins = hash_entry::is_empty (*e);
+      bool ins = Traits::is_empty (*e);
       if (ins)
 	{
 	  e->m_key = k;
 	  new ((void *) &e->m_value) Value (v);
+	  gcc_checking_assert (!Traits::is_empty (*e));
 	}
       else
 	e->m_value = v;
@@ -203,6 +204,7 @@ public:
 	{
 	  e->m_key = k;
 	  new ((void *)&e->m_value) Value ();
+	  gcc_checking_assert (!Traits::is_empty (*e));
 	}
 
       if (existed != NULL)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] hash-map: reject empty-looking insertions
@ 2022-12-28  5:23 Alexandre Oliva
  0 siblings, 0 replies; 4+ messages in thread
From: Alexandre Oliva @ 2022-12-28  5:23 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:28d32faff011eff7b8bd9a661eb5cbd1256cb95e

commit 28d32faff011eff7b8bd9a661eb5cbd1256cb95e
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Wed Dec 28 02:21:44 2022 -0300

    hash-map: reject empty-looking insertions
    
    Check, after inserting entries, that they don't look empty.
    
    
    for  gcc/ChangeLog
    
            * hash-map.h (put, get_or_insert): Check that entry does not
            look empty after insertion.

Diff:
---
 gcc/hash-map.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/hash-map.h b/gcc/hash-map.h
index 457967f4bf1..63fa21cf37c 100644
--- a/gcc/hash-map.h
+++ b/gcc/hash-map.h
@@ -169,11 +169,12 @@ public:
     {
       hash_entry *e = m_table.find_slot_with_hash (k, Traits::hash (k),
 						   INSERT);
-      bool ins = hash_entry::is_empty (*e);
+      bool ins = Traits::is_empty (*e);
       if (ins)
 	{
 	  e->m_key = k;
 	  new ((void *) &e->m_value) Value (v);
+	  gcc_checking_assert (!Traits::is_empty (*e));
 	}
       else
 	e->m_value = v;
@@ -203,6 +204,7 @@ public:
 	{
 	  e->m_key = k;
 	  new ((void *)&e->m_value) Value ();
+	  gcc_checking_assert (!Traits::is_empty (*e));
 	}
 
       if (existed != NULL)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] hash-map: reject empty-looking insertions
@ 2022-12-23  7:31 Alexandre Oliva
  0 siblings, 0 replies; 4+ messages in thread
From: Alexandre Oliva @ 2022-12-23  7:31 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:416cf7004097c58933d9a5e163aebe3243e3a54c

commit 416cf7004097c58933d9a5e163aebe3243e3a54c
Author: Alexandre Oliva <oliva@gnu.org>
Date:   Thu Dec 22 21:28:49 2022 -0300

    hash-map: reject empty-looking insertions

Diff:
---
 gcc/hash-map.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/hash-map.h b/gcc/hash-map.h
index 457967f4bf1..63fa21cf37c 100644
--- a/gcc/hash-map.h
+++ b/gcc/hash-map.h
@@ -169,11 +169,12 @@ public:
     {
       hash_entry *e = m_table.find_slot_with_hash (k, Traits::hash (k),
 						   INSERT);
-      bool ins = hash_entry::is_empty (*e);
+      bool ins = Traits::is_empty (*e);
       if (ins)
 	{
 	  e->m_key = k;
 	  new ((void *) &e->m_value) Value (v);
+	  gcc_checking_assert (!Traits::is_empty (*e));
 	}
       else
 	e->m_value = v;
@@ -203,6 +204,7 @@ public:
 	{
 	  e->m_key = k;
 	  new ((void *)&e->m_value) Value ();
+	  gcc_checking_assert (!Traits::is_empty (*e));
 	}
 
       if (existed != NULL)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] hash-map: reject empty-looking insertions
@ 2022-12-23  0:58 Alexandre Oliva
  0 siblings, 0 replies; 4+ messages in thread
From: Alexandre Oliva @ 2022-12-23  0:58 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d87263dfd2a7ad74b91239eb9c71967916889264

commit d87263dfd2a7ad74b91239eb9c71967916889264
Author: Alexandre Oliva <oliva@gnu.org>
Date:   Thu Dec 22 21:28:49 2022 -0300

    hash-map: reject empty-looking insertions

Diff:
---
 gcc/hash-map.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/hash-map.h b/gcc/hash-map.h
index 457967f4bf1..63fa21cf37c 100644
--- a/gcc/hash-map.h
+++ b/gcc/hash-map.h
@@ -169,11 +169,12 @@ public:
     {
       hash_entry *e = m_table.find_slot_with_hash (k, Traits::hash (k),
 						   INSERT);
-      bool ins = hash_entry::is_empty (*e);
+      bool ins = Traits::is_empty (*e);
       if (ins)
 	{
 	  e->m_key = k;
 	  new ((void *) &e->m_value) Value (v);
+	  gcc_checking_assert (!Traits::is_empty (*e));
 	}
       else
 	e->m_value = v;
@@ -203,6 +204,7 @@ public:
 	{
 	  e->m_key = k;
 	  new ((void *)&e->m_value) Value ();
+	  gcc_checking_assert (!Traits::is_empty (*e));
 	}
 
       if (existed != NULL)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-28  5:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-23  5:27 [gcc(refs/users/aoliva/heads/testme)] hash-map: reject empty-looking insertions Alexandre Oliva
  -- strict thread matches above, loose matches on Subject: below --
2022-12-28  5:23 Alexandre Oliva
2022-12-23  7:31 Alexandre Oliva
2022-12-23  0:58 Alexandre Oliva

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).