From 2e6578fb5e17cef7505aa9a1e76332c3b9eddd30 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 22 May 2011 00:12:24 -0700 Subject: [PATCH] * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN. --- src/ChangeLog | 4 ++++ src/lisp.h | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5518531bea8..67eaa09bf02 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-05-22 Paul Eggert + + * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN. + 2011-05-21 Paul Eggert * data.c: Avoid integer truncation in expressions involving floats. diff --git a/src/lisp.h b/src/lisp.h index b2beeffa79e..6618a754145 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -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. */ -- 2.39.2