diff options
| author | Tom Tromey | 2018-07-19 15:58:10 -0600 |
|---|---|---|
| committer | Tom Tromey | 2018-07-19 16:08:41 -0600 |
| commit | 76715f8921dca740880cd22c644a6328cd810846 (patch) | |
| tree | d85940e4c452575c453ab3ea6a7d0ec25b20f2ab /src/floatfns.c | |
| parent | 678881e428073b39a906c1ffd01e1b76e271cb5d (diff) | |
| download | emacs-76715f8921dca740880cd22c644a6328cd810846.tar.gz emacs-76715f8921dca740880cd22c644a6328cd810846.zip | |
Fix bignum creation when EMACS_INT is wider than long
* src/alloc.c (mpz_set_intmax_slow, mpz_set_uintmax_slow): New
functions.
* src/data.c (arith_driver, Frem, Fmod, ash_lsh_impl, Fadd1)
(Fsub1): Use mpz_set_intmax, mpz_set_uintmax.
* src/emacs-module.c (module_make_integer): Use mpz_set_intmax.
* src/floatfns.c (Fabs): Use mpz_set_intmax.
* src/lisp.h (mpz_set_intmax, mpz_set_uintmax): New inline
functions.
(mpz_set_uintmax_slow, mpz_set_intmax_slow): Declare.
Diffstat (limited to 'src/floatfns.c')
| -rw-r--r-- | src/floatfns.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/floatfns.c b/src/floatfns.c index 9a5f0a3ad2f..563c65f827a 100644 --- a/src/floatfns.c +++ b/src/floatfns.c | |||
| @@ -288,7 +288,8 @@ DEFUN ("abs", Fabs, Sabs, 1, 1, 0, | |||
| 288 | else if (FIXNUMP (arg) && XINT (arg) == MOST_NEGATIVE_FIXNUM) | 288 | else if (FIXNUMP (arg) && XINT (arg) == MOST_NEGATIVE_FIXNUM) |
| 289 | { | 289 | { |
| 290 | mpz_t val; | 290 | mpz_t val; |
| 291 | mpz_init_set_si (val, - MOST_NEGATIVE_FIXNUM); | 291 | mpz_init (val); |
| 292 | mpz_set_intmax (val, - MOST_NEGATIVE_FIXNUM); | ||
| 292 | arg = make_number (val); | 293 | arg = make_number (val); |
| 293 | mpz_clear (val); | 294 | mpz_clear (val); |
| 294 | } | 295 | } |