aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
authorPaul Eggert2019-06-27 12:31:27 -0700
committerPaul Eggert2019-06-27 12:35:09 -0700
commitf59a3f3d61c7da8a22ddb13185ae2271865ae155 (patch)
treeefc3b8dcdbafd11ddcd4532d701414f90e7de236 /src/lisp.h
parent4893a09c005cac81c05cd3db05c87225be6a7b42 (diff)
downloademacs-f59a3f3d61c7da8a22ddb13185ae2271865ae155.tar.gz
emacs-f59a3f3d61c7da8a22ddb13185ae2271865ae155.zip
Improve XFIXNUM cleanup a bit
Based on Pip Cet’s review (Bug#36370#13). * src/ccl.c (Fccl_execute_on_string): Use clearer indexing. * src/dosfns.c (Fint86, Fdos_memput): Avoid runtime checks for negative fixnums when debugging. This restores the earlier machine code. * src/lisp.h (XFIXNUM, XUFIXNUM): Use eassert, not eassume. (XFIXNAT): At the start, merely eassert FIXNUMP rather than eassuming FIXNATP. At the end, eassume that the result is nonnegative. This restores help to the compiler that the previous patch mistakenly removed.
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 077d2360654..a0619e64f20 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1195,7 +1195,7 @@ INLINE bool
1195INLINE EMACS_INT 1195INLINE EMACS_INT
1196XFIXNUM (Lisp_Object a) 1196XFIXNUM (Lisp_Object a)
1197{ 1197{
1198 eassume (FIXNUMP (a)); 1198 eassert (FIXNUMP (a));
1199 return XFIXNUM_RAW (a); 1199 return XFIXNUM_RAW (a);
1200} 1200}
1201 1201
@@ -1209,7 +1209,7 @@ XUFIXNUM_RAW (Lisp_Object a)
1209INLINE EMACS_UINT 1209INLINE EMACS_UINT
1210XUFIXNUM (Lisp_Object a) 1210XUFIXNUM (Lisp_Object a)
1211{ 1211{
1212 eassume (FIXNUMP (a)); 1212 eassert (FIXNUMP (a));
1213 return XUFIXNUM_RAW (a); 1213 return XUFIXNUM_RAW (a);
1214} 1214}
1215 1215
@@ -2828,9 +2828,11 @@ FIXNATP (Lisp_Object x)
2828INLINE EMACS_INT 2828INLINE EMACS_INT
2829XFIXNAT (Lisp_Object a) 2829XFIXNAT (Lisp_Object a)
2830{ 2830{
2831 eassume (FIXNATP (a)); 2831 eassert (FIXNUMP (a));
2832 EMACS_INT int0 = Lisp_Int0; 2832 EMACS_INT int0 = Lisp_Int0;
2833 return USE_LSB_TAG ? XFIXNUM (a) : XLI (a) - (int0 << VALBITS); 2833 EMACS_INT result = USE_LSB_TAG ? XFIXNUM (a) : XLI (a) - (int0 << VALBITS);
2834 eassume (0 <= result);
2835 return result;
2834} 2836}
2835 2837
2836INLINE bool 2838INLINE bool