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 /src/fns.c | |
| 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 'src/fns.c')
| -rw-r--r-- | src/fns.c | 9 |
1 files changed, 6 insertions, 3 deletions
| @@ -2950,9 +2950,12 @@ suppressed. */) | |||
| 2950 | But not more than once in any file, | 2950 | But not more than once in any file, |
| 2951 | and not when we aren't loading or reading from a file. */ | 2951 | and not when we aren't loading or reading from a file. */ |
| 2952 | if (!from_file) | 2952 | if (!from_file) |
| 2953 | for (tem = Vcurrent_load_list; CONSP (tem); tem = XCDR (tem)) | 2953 | { |
| 2954 | if (NILP (XCDR (tem)) && STRINGP (XCAR (tem))) | 2954 | Lisp_Object tail = Vcurrent_load_list; |
| 2955 | from_file = 1; | 2955 | FOR_EACH_TAIL_SAFE (tail) |
| 2956 | if (NILP (XCDR (tail)) && STRINGP (XCAR (tail))) | ||
| 2957 | from_file = true; | ||
| 2958 | } | ||
| 2956 | 2959 | ||
| 2957 | if (from_file) | 2960 | if (from_file) |
| 2958 | { | 2961 | { |