From e6966cd635f324edcc27adecb82cd85c71cbfcad Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 14 Jun 2011 15:32:12 -0700 Subject: * fns.c: Don't overflow int when computing a list length. (Fsafe_length): Return a float if the value is not representable as a fixnum. This shouldn't happen except in contrived situations. Use same QUIT_COUNT_HEURISTIC as Flength now does. --- src/ChangeLog | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/ChangeLog') diff --git a/src/ChangeLog b/src/ChangeLog index 5d70c56cc5c..3c690a5cae0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,10 +1,14 @@ 2011-06-14 Paul Eggert - * fns.c (Flength): Don't overflow int when computing a list length. - Use EMACS_INT, not int, to avoid unwanted truncation on 64-bit hosts. - Check for QUIT every 1024 entries rather than every other entry; - that's faster and is responsive enough. Report an error instead of - overflowing an integer. + * fns.c: Don't overflow int when computing a list length. + * fns.c (QUIT_COUNT_HEURISTIC): New constant. + (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted + truncation on 64-bit hosts. Check for QUIT every + QUIT_COUNT_HEURISTIC entries rather than every other entry; that's + faster and is responsive enough. + (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. * alloc.c: Check that resized vectors' lengths fit in fixnums. (header_size, word_size): New constants. -- cgit v1.2.1