summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fns.c2
-rw-r--r--src/lisp.h1
-rw-r--r--src/pdumper.c2
3 files changed, 4 insertions, 1 deletions
diff --git a/src/fns.c b/src/fns.c
index 8eefa7c72b2..734a2e253c7 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -4017,7 +4017,7 @@ hashfn_eql (Lisp_Object key, struct Lisp_Hash_Table *h)
/* 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 };
diff --git a/src/lisp.h b/src/lisp.h
index 9d37629bc46..e96fcfe94d3 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3606,6 +3606,7 @@ EMACS_UINT hash_string (char const *, ptrdiff_t);
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 *);
diff --git a/src/pdumper.c b/src/pdumper.c
index 2abac80a372..cda8b40be4c 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -2628,6 +2628,8 @@ dump_vectorlike_generic (struct dump_context *ctx,
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);