diff options
| author | Paul Eggert | 2019-08-21 17:18:33 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-08-21 17:21:06 -0700 |
| commit | 951ea375d52891f79b89794fbb9dca86ab8cd5a8 (patch) | |
| tree | 459efbdb4329bd8e5926f5f21b1e170505443bce /test/src/lread-tests.el | |
| parent | 11de1155f81fdac515b5465d31634c7b91a4d42a (diff) | |
| download | emacs-951ea375d52891f79b89794fbb9dca86ab8cd5a8.tar.gz emacs-951ea375d52891f79b89794fbb9dca86ab8cd5a8.zip | |
Don’t hard-loop on cycles in ‘read’ etc.
Problem for ‘read’ reported by Pip Cet in:
https://lists.gnu.org/r/emacs-devel/2019-08/msg00316.html
* src/fns.c (Frequire): Protect against circular current-load-list.
* src/lread.c (Fget_load_suffixes):
Protect against circular load-suffixes or load-file-rep-suffixes.
(Fload): Protect against circular loads-in-progress.
(openp): Protect against circular PATH and SUFFIXES.
(build_load_history): Protect against circular load-history or
current-load-list.
(readevalloop_eager_expand_eval): Protect against circular SUBFORMS.
(read1): Protect against circular data.
* test/src/lread-tests.el (lread-circular-hash): New test.
Diffstat (limited to 'test/src/lread-tests.el')
| -rw-r--r-- | test/src/lread-tests.el | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el index 82b75b195ca..ba5bfe0145d 100644 --- a/test/src/lread-tests.el +++ b/test/src/lread-tests.el | |||
| @@ -220,4 +220,7 @@ literals (Bug#20852)." | |||
| 220 | (* most-positive-fixnum most-positive-fixnum))) | 220 | (* most-positive-fixnum most-positive-fixnum))) |
| 221 | (should (= n (string-to-number (format "%d." n)))))) | 221 | (should (= n (string-to-number (format "%d." n)))))) |
| 222 | 222 | ||
| 223 | (ert-deftest lread-circular-hash () | ||
| 224 | (should-error (read "#s(hash-table data #0=(#0# . #0#))"))) | ||
| 225 | |||
| 223 | ;;; lread-tests.el ends here | 226 | ;;; lread-tests.el ends here |