/* Given HT, return a hash code for KEY which uses a user-defined
function to compare keys. */
-static Lisp_Object
+Lisp_Object
hashfn_user_defined (Lisp_Object key, struct Lisp_Hash_Table *h)
{
Lisp_Object args[] = { h->test.user_hash_function, key };
EMACS_UINT sxhash (Lisp_Object, int);
Lisp_Object hashfn_eql (Lisp_Object, struct Lisp_Hash_Table *);
Lisp_Object hashfn_equal (Lisp_Object, struct Lisp_Hash_Table *);
+Lisp_Object hashfn_user_defined (Lisp_Object, struct Lisp_Hash_Table *);
Lisp_Object make_hash_table (struct hash_table_test, EMACS_INT, float, float,
Lisp_Object, bool);
ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object *);
static bool
dump_hash_table_stable_p (const struct Lisp_Hash_Table *hash)
{
+ if (hash->test.hashfn == hashfn_user_defined)
+ error ("cannot dump hash tables with user-defined tests"); /* Bug#36769 */
bool is_eql = hash->test.hashfn == hashfn_eql;
bool is_equal = hash->test.hashfn == hashfn_equal;
ptrdiff_t size = HASH_TABLE_SIZE (hash);