diff options
| author | Paul Eggert | 2018-07-21 00:25:27 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-07-21 00:26:10 -0700 |
| commit | 1780502da6b9ac8d3063dfd56f675318568283dc (patch) | |
| tree | 6b97996cb7d228f5d60e0f32c2b8826229d6f0ab | |
| parent | 2c242cb1a2956ecfa894d0110b837d4ecc43a69c (diff) | |
| download | emacs-1780502da6b9ac8d3063dfd56f675318568283dc.tar.gz emacs-1780502da6b9ac8d3063dfd56f675318568283dc.zip | |
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
| -rw-r--r-- | src/lread.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lread.c b/src/lread.c index 4eba8635521..50fc6ef8f3a 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -3798,10 +3798,11 @@ string_to_number (char const *string, int base, int flags) | |||
| 3798 | 3798 | ||
| 3799 | if (! (state & DOT_CHAR) && ! (flags & S2N_OVERFLOW_TO_FLOAT)) | 3799 | if (! (state & DOT_CHAR) && ! (flags & S2N_OVERFLOW_TO_FLOAT)) |
| 3800 | { | 3800 | { |
| 3801 | AUTO_STRING (fmt, ("%s is out of fixnum range; " | 3801 | AUTO_STRING (fmt, ("%s (base %d) is out of fixnum range; " |
| 3802 | "maybe set `read-integer-overflow-as-float'?")); | 3802 | "maybe set `read-integer-overflow-as-float'?")); |
| 3803 | AUTO_STRING_WITH_LEN (arg, string, cp - string); | 3803 | AUTO_STRING_WITH_LEN (arg, string, cp - string); |
| 3804 | xsignal1 (Qoverflow_error, CALLN (Fformat_message, fmt, arg)); | 3804 | xsignal1 (Qoverflow_error, |
| 3805 | CALLN (Fformat_message, fmt, arg, make_number (base))); | ||
| 3805 | } | 3806 | } |
| 3806 | } | 3807 | } |
| 3807 | 3808 | ||