bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#46722: test-map-into fails


From: Stefan Monnier
Subject: bug#46722: test-map-into fails
Date: Wed, 05 Jan 2022 13:24:40 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> Is it? how so?  copy-sequence is not a trivial operation, at least not
> with arbitrary data structures.

This is used on the `key` argument of `gethash/puthash` on a hash-table
defined to use `:test #'equal`.  And it is used on a value which is
defined to be a list.

For this reason, I think it is very safe.

The reason why the current code only misfires "rarely" is that in most
cases, when we change by side-effect an object that's a key in an
`equal` hashtable, the result is a hashtable where this entry can't be
found (because its hash doesn't match any more), so we end up
luckily not making use of this (now broken) entry.

So the underlying bug only appears if either the hash-table is rehashed
or the new `sxhash-equal` value happens to the same as the old one.

> And we nowadays use generics a lot, so this could potentially affect
> gobs of code.  So I'd rather we didn't install this on the
> release branch.

Fine by me,


        Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]