* lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 22 May 2011 07:12:24 +0000 (00:12 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 22 May 2011 07:12:24 +0000 (00:12 -0700)
src/ChangeLog
src/lisp.h

index 5518531..67eaa09 100644 (file)
@@ -1,3 +1,7 @@
+2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
+
 2011-05-21  Paul Eggert  <eggert@cs.ucla.edu>
 
        * data.c: Avoid integer truncation in expressions involving floats.
index b2beeff..6618a75 100644 (file)
@@ -544,11 +544,10 @@ extern Lisp_Object make_number (EMACS_INT);
 
 /* Value is non-zero if I doesn't fit into a Lisp fixnum.  It is
    written this way so that it also works if I is of unsigned
-   type.  */
+   type or if I is a NaN.  */
 
 #define FIXNUM_OVERFLOW_P(i) \
-  ((i) > MOST_POSITIVE_FIXNUM \
-   || ((i) < 0 && (i) < MOST_NEGATIVE_FIXNUM))
+  (! ((0 <= (i) || MOST_NEGATIVE_FIXNUM <= (i)) && (i) <= MOST_POSITIVE_FIXNUM))
 
 /* Extract a value or address from a Lisp_Object.  */