]> git.eshelyaron.com Git - emacs.git/commit
Fix fileio.c infloops on circular lists
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 30 Oct 2019 21:17:40 +0000 (14:17 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 30 Oct 2019 21:43:14 +0000 (14:43 -0700)
commit40ae02ff50a8f05660a7f9f234320875b6358c9d
treec5d4a135409445f1886cda3001bfa41472f8b3fb
parent94b8153eaa78e376e6ed8c2b04602edf3dadc007
Fix fileio.c infloops on circular lists

Fix infinite loops in fileio.c when a circular list is the
value of after_insert_file_functions,
buffer-auto-save-file-format, buffer-file-format, or
write-region-annotate-functions.
* src/fileio.c (Finsert_file_contents, build_annotations):
Use FOR_EACH_TAIL to avoid infloop on circular lists.
(build_annotations): Use an EMACS_INT, not an int, to count
nesting level.
* test/src/fileio-tests.el:
(fileio-tests--circular-after-insert-file-functions): New test.
src/fileio.c
test/src/fileio-tests.el