Mercurial > hg > xemacs-beta
diff src/fns.c @ 5355:70b15ac66ee5
Correct a bug with circularity checking in #'mapcar*, #'map, etc.
src/ChangeLog addition:
2011-02-10 Aidan Kehoe <kehoea@parhasard.net>
* fns.c (shortest_length_among_sequences):
This was buggy, it always errored if the last argument was
circular, even if other arguments were non-circular. Correct that.
tests/ChangeLog addition:
2011-02-10 Aidan Kehoe <kehoea@parhasard.net>
* automated/lisp-tests.el:
* automated/lisp-tests.el (mapcar*):
If multiple SEQUENCE arguments are passed to #'mapcar*, and the
last one is circular while the others aren't, make sure that
#'mapcar* doesn't error.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Thu, 10 Feb 2011 08:46:10 +0000 |
parents | 94bbd4792049 |
children | f5a5501814f5 00e79bbbe48f |
line wrap: on
line diff
--- a/src/fns.c Wed Feb 09 20:15:50 2011 +0000 +++ b/src/fns.c Thu Feb 10 08:46:10 2011 +0000 @@ -7145,7 +7145,7 @@ static Elemcount shortest_length_among_sequences (int nsequences, Lisp_Object *sequences) { - Elemcount len = EMACS_INT_MAX; + Elemcount len = 1 + EMACS_INT_MAX; Lisp_Object length = Qnil; int i; @@ -7167,7 +7167,7 @@ } } - if (NILP (length)) + if (len == 1 + EMACS_INT_MAX) { signal_circular_list_error (sequences[0]); }