diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-01-10 21:35:31 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-01-10 21:39:56 -0800 |
commit | 470082de55f7b1c1cde8aabbb5b8de55b4b08f83 (patch) | |
tree | 73f67a8951cdeb998a822fd38a6abd242b16199a /lisp/emacs-lisp/avl-tree.el | |
parent | 9609db9d98babfe8782a03aebe46176e57905c63 (diff) | |
download | emacs-470082de55f7b1c1cde8aabbb5b8de55b4b08f83.tar.gz emacs-470082de55f7b1c1cde8aabbb5b8de55b4b08f83.tar.bz2 emacs-470082de55f7b1c1cde8aabbb5b8de55b4b08f83.zip |
List lengths are always fixnums now
Without this patch, it was theoretically possible for a list
length to be a bignum, which means that safe-length could
signal an error (due to generating a too-large bignum) contrary
to its documentation. Fix things to remove the theoretical
possibility, so that list lengths are always fixnums (and so
that list lenghts are always ptrdiff_t values too, since that
is assumed internally anyway).
* src/alloc.c (Fcons): Do not allocate so many conses that
a list length won’t fit into ptrdiff_t or into fixnum.
This matters only on weird platforms; on typical platforms,
list lengths always fit anyway.
* src/fns.c (list_length, Fsafe_length, proper-list-p):
Remove integer overflow checks that are no longer needed.
Diffstat (limited to 'lisp/emacs-lisp/avl-tree.el')
0 files changed, 0 insertions, 0 deletions