Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
6346d301
Commit
6346d301
authored
Jun 14, 2011
by
Paul Eggert
Browse files
* fns.c (Fnthcdr, Fsort): Don't assume list length fits in int.
parent
e6966cd6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
src/ChangeLog
src/ChangeLog
+1
-0
src/fns.c
src/fns.c
+2
-2
No files found.
src/ChangeLog
View file @
6346d301
...
...
@@ -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.
...
...
src/fns.c
View file @
6346d301
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment