diff options
author | Alexandre Oliva <oliva@adacore.com> | 2022-12-30 13:44:50 -0300 |
---|---|---|
committer | Alexandre Oliva <oliva@gnu.org> | 2022-12-30 13:44:50 -0300 |
commit | 012fdbc14233fbb463fd27a05493050d1b88aecf (patch) | |
tree | 9bdce03edf34e0a5679d4af059b1e818f3a2521e /gcc/fibonacci_heap.cc | |
parent | ebf7dd754a95bf9680bc53331a6b70f0cf83c045 (diff) | |
download | gcc-012fdbc14233fbb463fd27a05493050d1b88aecf.zip gcc-012fdbc14233fbb463fd27a05493050d1b88aecf.tar.gz gcc-012fdbc14233fbb463fd27a05493050d1b88aecf.tar.bz2 |
check hash table insertions
I've noticed a number of potential problems in hash tables, of three
kinds: insertion of entries that seem empty, dangling insertions, and
lookups during insertions.
These problems may all have the effect of replacing a deleted entry
with one that seems empty, which may disconnect double-hashing chains
involving that entry, and thus cause entries to go missing.
This patch detects such problems by recording a pending insertion and
checking that it's completed before other potentially-conflicting
operations. The additional field is only introduced when checking is
enabled.
for gcc/ChnageLog
* hash-table.h (check_complete_insertion, check_insert_slot):
New hash_table methods.
(m_inserting_slot): New hash_table field.
(begin, hash_table ctors, ~hash_table): Check previous insert.
(expand, empty_slow, clear_slot, find_with_hash): Likewise.
(remote_elt_with_hash, traverse_noresize): Likewise.
(gt_pch_nx): Likewise.
(find_slot_with_hash): Likewise. Record requested insert.
Diffstat (limited to 'gcc/fibonacci_heap.cc')
0 files changed, 0 insertions, 0 deletions