aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lread.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/lread.c b/src/lread.c
index bcb695c3dae..3a2d9c8a6d3 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3792,21 +3792,16 @@ string_to_number (char const *string, int base, int flags)
3792 range, use its value, preferably as a fixnum. */ 3792 range, use its value, preferably as a fixnum. */
3793 if (leading_digit >= 0 && ! float_syntax) 3793 if (leading_digit >= 0 && ! float_syntax)
3794 { 3794 {
3795 if (state & INTOVERFLOW) 3795 if ((state & INTOVERFLOW) == 0
3796 { 3796 && n <= (negative ? -MOST_NEGATIVE_FIXNUM : MOST_POSITIVE_FIXNUM))
3797 /* Unfortunately there's no simple and accurate way to convert
3798 non-base-10 numbers that are out of C-language range. */
3799 if (base != 10)
3800 flags = 0;
3801 }
3802 else if (n <= (negative ? -MOST_NEGATIVE_FIXNUM : MOST_POSITIVE_FIXNUM))
3803 { 3797 {
3804 EMACS_INT signed_n = n; 3798 EMACS_INT signed_n = n;
3805 return make_fixnum (negative ? -signed_n : signed_n); 3799 return make_fixnum (negative ? -signed_n : signed_n);
3806 } 3800 }
3807 else
3808 value = n;
3809 3801
3802 /* Skip a leading "+". */
3803 if (signedp && !negative)
3804 ++string;
3810 return make_bignum_str (string, base); 3805 return make_bignum_str (string, base);
3811 } 3806 }
3812 3807