Report base of out-of-range input fixnums
* src/lread.c (string_to_number): Report the base of an out-of-range fixnum. Problem reported by Andy Moreton in: https://lists.gnu.org/r/emacs-devel/2018-07/msg00696.html
This commit is contained in:
parent
2c242cb1a2
commit
1780502da6
1 changed files with 3 additions and 2 deletions
|
@ -3798,10 +3798,11 @@ string_to_number (char const *string, int base, int flags)
|
|||
|
||||
if (! (state & DOT_CHAR) && ! (flags & S2N_OVERFLOW_TO_FLOAT))
|
||||
{
|
||||
AUTO_STRING (fmt, ("%s is out of fixnum range; "
|
||||
AUTO_STRING (fmt, ("%s (base %d) is out of fixnum range; "
|
||||
"maybe set `read-integer-overflow-as-float'?"));
|
||||
AUTO_STRING_WITH_LEN (arg, string, cp - string);
|
||||
xsignal1 (Qoverflow_error, CALLN (Fformat_message, fmt, arg));
|
||||
xsignal1 (Qoverflow_error,
|
||||
CALLN (Fformat_message, fmt, arg, make_number (base)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue