emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master ecd7a94: Fix expt signedness bug --without-wide-int


From: Paul Eggert
Subject: [Emacs-diffs] master ecd7a94: Fix expt signedness bug --without-wide-int
Date: Sun, 19 Aug 2018 13:06:17 -0400 (EDT)

branch: master
commit ecd7a9407711ebe24d7e07d4402a2d66754ee693
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Fix expt signedness bug --without-wide-int
    
    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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/floatfns.c b/src/floatfns.c
index 54d068c..7c52a0a 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]