aboutsummaryrefslogtreecommitdiffstats
path: root/src/mem-limits.h
diff options
context:
space:
mode:
authorPaul Eggert2012-02-20 15:09:58 -0800
committerPaul Eggert2012-02-20 15:09:58 -0800
commit310f5bd4294ec3624b425e2c27da6fc730d0e928 (patch)
treeb1989e75f50a4c50c9b5fe34b698c93c2abec7ff /src/mem-limits.h
parent132b9726f60888f990e6174ce430769eb9dda986 (diff)
downloademacs-310f5bd4294ec3624b425e2c27da6fc730d0e928.tar.gz
emacs-310f5bd4294ec3624b425e2c27da6fc730d0e928.zip
Fix crash due to non-contiguous EMACS_INT (Bug#10780).
* lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it. (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0. It's useless in that case, and it can cause problems on hosts that allocate halves of EMACS_INT values separately. Reported by Dan HorĂ¡k. Diagnosed by Andreas Schwab in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>. * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where UINTPTR_MAX >> VALBITS == 0. This is required by the above change; it avoids undefined behavior on hosts where shifting right by more than the word width has undefined behavior.
Diffstat (limited to 'src/mem-limits.h')
-rw-r--r--src/mem-limits.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mem-limits.h b/src/mem-limits.h
index 472e591b38d..244592a9768 100644
--- a/src/mem-limits.h
+++ b/src/mem-limits.h
@@ -34,7 +34,7 @@ extern int etext;
34#endif 34#endif
35 35
36extern char *start_of_data (void); 36extern char *start_of_data (void);
37#if defined USE_LSB_TAG 37#if defined USE_LSB_TAG || UINTPTR_MAX >> VALBITS == 0
38#define EXCEEDS_LISP_PTR(ptr) 0 38#define EXCEEDS_LISP_PTR(ptr) 0
39#elif defined DATA_SEG_BITS 39#elif defined DATA_SEG_BITS
40#define EXCEEDS_LISP_PTR(ptr) \ 40#define EXCEEDS_LISP_PTR(ptr) \