aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-06-14 15:39:35 -0700
committerPaul Eggert2011-06-14 15:39:35 -0700
commit6346d30171fa8047e292076a2407fedee64479da (patch)
tree404bf2d77a4c5bc891edae4f8a1238e67a54ee6c /src
parente6966cd635f324edcc27adecb82cd85c71cbfcad (diff)
downloademacs-6346d30171fa8047e292076a2407fedee64479da.tar.gz
emacs-6346d30171fa8047e292076a2407fedee64479da.zip
* fns.c (Fnthcdr, Fsort): Don't assume list length fits in int.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog1
-rw-r--r--src/fns.c4
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 @@
9 (Flength): Report an error instead of overflowing an integer. 9 (Flength): Report an error instead of overflowing an integer.
10 (Fsafe_length): Return a float if the value is not representable 10 (Fsafe_length): Return a float if the value is not representable
11 as a fixnum. This shouldn't happen except in contrived situations. 11 as a fixnum. This shouldn't happen except in contrived situations.
12 (Fnthcdr, Fsort): Don't assume list length fits in int.
12 13
13 * alloc.c: Check that resized vectors' lengths fit in fixnums. 14 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14 (header_size, word_size): New constants. 15 (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,
1286 doc: /* Take cdr N times on LIST, return the result. */) 1286 doc: /* Take cdr N times on LIST, return the result. */)
1287 (Lisp_Object n, Lisp_Object list) 1287 (Lisp_Object n, Lisp_Object list)
1288{ 1288{
1289 register int i, num; 1289 EMACS_INT i, num;
1290 CHECK_NUMBER (n); 1290 CHECK_NUMBER (n);
1291 num = XINT (n); 1291 num = XINT (n);
1292 for (i = 0; i < num && !NILP (list); i++) 1292 for (i = 0; i < num && !NILP (list); i++)
@@ -1751,7 +1751,7 @@ if the first element should sort before the second. */)
1751 Lisp_Object front, back; 1751 Lisp_Object front, back;
1752 register Lisp_Object len, tem; 1752 register Lisp_Object len, tem;
1753 struct gcpro gcpro1, gcpro2; 1753 struct gcpro gcpro1, gcpro2;
1754 register int length; 1754 EMACS_INT length;
1755 1755
1756 front = list; 1756 front = list;
1757 len = Flength (list); 1757 len = Flength (list);