diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-07-20 19:40:03 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-07-20 20:13:46 -0700 |
commit | 515afc9c15870cd7bd6b96e2d8b89938116923ac (patch) | |
tree | e57bf126a8e6076edb1c4fa87e4908c94fd8d779 /lisp/emacs-lisp/inline.el | |
parent | b6f194a0fb6dbd1b19aa01f95a955f5b8b23b40e (diff) | |
download | emacs-515afc9c15870cd7bd6b96e2d8b89938116923ac.tar.gz emacs-515afc9c15870cd7bd6b96e2d8b89938116923ac.tar.bz2 emacs-515afc9c15870cd7bd6b96e2d8b89938116923ac.zip |
Fix crash if user test munges hash table
* src/fns.c (restore_mutability)
(hash_table_user_defined_call): New functions.
(cmpfn_user_defined, hashfn_user_defined): Use them.
(make_hash_table, copy_hash_table):
Mark new hash table as mutable.
(check_mutable_hash_table): New function.
(Fclrhash, Fputhash, Fremhash): Use it instead of CHECK_IMPURE.
* src/lisp.h (struct hash_table_test): User-defined functions
now take pointers to struct Lisp_Hash_Table, not to struct
hash_table_test. All uses changed.
(struct Lisp_Hash_Table): New member ‘mutable’.
* src/pdumper.c (dump_hash_table): Copy it.
* test/src/fns-tests.el (test-hash-function-that-mutates-hash-table):
New test, which tests for the bug.
Diffstat (limited to 'lisp/emacs-lisp/inline.el')
0 files changed, 0 insertions, 0 deletions