]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix expt signedness bug --without-wide-int
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 19 Aug 2018 17:05:41 +0000 (10:05 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 19 Aug 2018 17:06:12 +0000 (10:06 -0700)
Problem reported by Federico in:
https://lists.gnu.org/r/emacs-devel/2018-08/msg00619.html
* src/floatfns.c (Fexpt): Use TYPE_RANGED_FIXNUMP, not
RANGED_FIXNUMP, to fix bug with unsigned comparison on
platforms built --without-wide-int.

src/floatfns.c

index 54d068c29e5d8e8e683fb323ecd846f3b601c8b0..7c52a0a9a20170a5d4c54c1c5ddd0ced328369a1 100644 (file)
@@ -212,7 +212,7 @@ DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0,
   if (INTEGERP (arg1) && NATNUMP (arg2))
     {
       unsigned long exp;
-      if (RANGED_FIXNUMP (0, arg2, ULONG_MAX))
+      if (TYPE_RANGED_FIXNUMP (unsigned long, arg2))
        exp = XFIXNUM (arg2);
       else if (MOST_POSITIVE_FIXNUM < ULONG_MAX && BIGNUMP (arg2)
               && mpz_fits_ulong_p (XBIGNUM (arg2)->value))