From 6346d30171fa8047e292076a2407fedee64479da Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 14 Jun 2011 15:39:35 -0700 Subject: [PATCH] * fns.c (Fnthcdr, Fsort): Don't assume list length fits in int. --- src/ChangeLog | 1 + src/fns.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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); -- 2.39.2