diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-10-30 14:40:06 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-10-30 14:43:14 -0700 |
commit | f2a72bb8ed29223dd1197492d4270c171db5e443 (patch) | |
tree | 60d90f60474f34750bf6c95b356c6128529cb1a4 /lisp/emacs-lisp/lisp-mode.el | |
parent | 581601e650cc8bdcf3ed83c6ae36744601c12ce9 (diff) | |
download | emacs-f2a72bb8ed29223dd1197492d4270c171db5e443.tar.gz emacs-f2a72bb8ed29223dd1197492d4270c171db5e443.tar.bz2 emacs-f2a72bb8ed29223dd1197492d4270c171db5e443.zip |
Fix print.c infloop on circular lists
Fix infinite loops in print.c when a circular list is passed
to command-error-default-function or to error-message-string.
* src/print.c (print_error_message):
Use FOR_EACH_TAIL to avoid infloop on circular lists.
(print_object): Use FOR_EACH_TAIL_SAFE, as it uses
Brent’s teleporting tortoise-hare algorithm which is
asymptotically better than the classic tortoise-hare
algorithm that the code wsas using.
* test/src/print-tests.el (print-circle-2): When print-circle
is nil, do not insist on a particular cycle-detection heuristic.
(error-message-string-circular): New test.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
0 files changed, 0 insertions, 0 deletions