aboutsummaryrefslogtreecommitdiffstats
path: root/src/emacs-module.c
diff options
context:
space:
mode:
authorTom Tromey2018-07-19 15:58:10 -0600
committerTom Tromey2018-07-19 16:08:41 -0600
commit76715f8921dca740880cd22c644a6328cd810846 (patch)
treed85940e4c452575c453ab3ea6a7d0ec25b20f2ab /src/emacs-module.c
parent678881e428073b39a906c1ffd01e1b76e271cb5d (diff)
downloademacs-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/emacs-module.c')
-rw-r--r--src/emacs-module.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 7709eeca94a..39150f6f67b 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -536,7 +536,8 @@ module_make_integer (emacs_env *env, intmax_t n)
536 if (FIXNUM_OVERFLOW_P (n)) 536 if (FIXNUM_OVERFLOW_P (n))
537 { 537 {
538 mpz_t val; 538 mpz_t val;
539 mpz_init_set_si (val, n); 539 mpz_init (val);
540 mpz_set_intmax (val, n);
540 obj = make_number (val); 541 obj = make_number (val);
541 mpz_clear (val); 542 mpz_clear (val);
542 } 543 }