[15/17] prevent hash set/map insertion of deleted entries
Jeff Law
jeffreyalaw@gmail.com
Thu Dec 29 04:25:50 GMT 2022
On 12/28/22 05:32, Alexandre Oliva via Gcc-patches wrote:
> On Dec 27, 2022, David Malcolm <dmalcolm@redhat.com> wrote:
>
>> Would it make sense to also add assertions that such entries aren't
>> Traits::is_deleted? (both for hash_map and hash_set)
>
> Yeah, I guess so. I've come up with something for hash-table proper
> too, coming up in 17/17.
>
>
> Just like the recently-added checks for empty entries, add checks for
> deleted entries as well. This didn't catch any problems, but it might
> prevent future accidents. Suggested by David Malcolm.
>
> Regstrapped on x86_64-linux-gnu. Ok to install?
>
>
> for gcc/ChangeLog
>
> * hash-map.h (put, get_or_insert): Check that added entry
> doesn't look deleted either.
> & hash-set.h (add): Likewise.
OK
jeff
More information about the Gcc-patches
mailing list