diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/emacs-module.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/emacs-module.c b/src/emacs-module.c index cf92b0fdb51..2ba5540d9a1 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c | |||
| @@ -27,7 +27,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 27 | #include <stdio.h> | 27 | #include <stdio.h> |
| 28 | 28 | ||
| 29 | #include "lisp.h" | 29 | #include "lisp.h" |
| 30 | #include "bignum.h" | ||
| 31 | #include "dynlib.h" | 30 | #include "dynlib.h" |
| 32 | #include "coding.h" | 31 | #include "coding.h" |
| 33 | #include "keyboard.h" | 32 | #include "keyboard.h" |
| @@ -522,11 +521,10 @@ module_extract_integer (emacs_env *env, emacs_value n) | |||
| 522 | CHECK_INTEGER (l); | 521 | CHECK_INTEGER (l); |
| 523 | if (BIGNUMP (l)) | 522 | if (BIGNUMP (l)) |
| 524 | { | 523 | { |
| 525 | /* FIXME: This can incorrectly signal overflow on platforms | 524 | intmax_t i = bignum_to_intmax (l); |
| 526 | where long is narrower than intmax_t. */ | 525 | if (i == 0) |
| 527 | if (!mpz_fits_slong_p (XBIGNUM (l)->value)) | ||
| 528 | xsignal1 (Qoverflow_error, l); | 526 | xsignal1 (Qoverflow_error, l); |
| 529 | return mpz_get_si (XBIGNUM (l)->value); | 527 | return i; |
| 530 | } | 528 | } |
| 531 | return XFIXNUM (l); | 529 | return XFIXNUM (l); |
| 532 | } | 530 | } |