Be consistent about list length fixnum overflow

* src/fns.c (Flength, Fproper_list_p): Use overflow_error to
report the (typically impossible) fixnum overflow.
This commit is contained in:
Paul Eggert 2019-01-01 11:41:16 -08:00
parent 504457673d
commit ba1b340988

View file

@ -118,7 +118,7 @@ To get the number of bytes, use `string-bytes'. */)
i++;
CHECK_LIST_END (sequence, sequence);
if (MOST_POSITIVE_FIXNUM < i)
error ("List too long");
overflow_error ();
val = make_fixnum (i);
}
else if (NILP (sequence))
@ -161,7 +161,7 @@ A proper list is neither circular nor dotted (i.e., its last cdr is nil). */
if (!NILP (last_tail))
return Qnil;
if (MOST_POSITIVE_FIXNUM < len)
xsignal0 (Qoverflow_error);
overflow_error ();
return make_fixnum (len);
}