From: Paul Eggert Date: Tue, 14 Jun 2011 22:39:35 +0000 (-0700) Subject: * fns.c (Fnthcdr, Fsort): Don't assume list length fits in int. X-Git-Tag: emacs-pretest-24.0.90~104^2~548^2~8 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6346d30171fa8047e292076a2407fedee64479da;p=emacs.git * fns.c (Fnthcdr, Fsort): Don't assume list length fits in int. --- diff --git a/src/ChangeLog b/src/ChangeLog index 3c690a5cae0..4326bad03fc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -9,6 +9,7 @@ (Flength): Report an error instead of overflowing an integer. (Fsafe_length): Return a float if the value is not representable as a fixnum. This shouldn't happen except in contrived situations. + (Fnthcdr, Fsort): Don't assume list length fits in int. * alloc.c: Check that resized vectors' lengths fit in fixnums. (header_size, word_size): New constants. diff --git a/src/fns.c b/src/fns.c index 10af162cfc4..987d5a6564d 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1286,7 +1286,7 @@ DEFUN ("nthcdr", Fnthcdr, Snthcdr, 2, 2, 0, doc: /* Take cdr N times on LIST, return the result. */) (Lisp_Object n, Lisp_Object list) { - register int i, num; + EMACS_INT i, num; CHECK_NUMBER (n); num = XINT (n); for (i = 0; i < num && !NILP (list); i++) @@ -1751,7 +1751,7 @@ if the first element should sort before the second. */) Lisp_Object front, back; register Lisp_Object len, tem; struct gcpro gcpro1, gcpro2; - register int length; + EMACS_INT length; front = list; len = Flength (list);