>From cfd5e106c3c9334de93ccda0d65523476553fb1f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 26 May 2020 00:47:24 -0700 Subject: [PATCH] Port struct Lisp_FLoat to oddball platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * src/lisp.h (struct Lisp_Float): Declare via GCALIGNED_UNION_MEMBER, not via GCALIGNED_STRUCT, since alloc.c creates these in arrays and GCALIGNED_STRUCT does not necessarily suffice to align struct Lisp_Float when it’s used in an array. This avoids undefined behavior on oddball machines where sizeof (struct Lisp_Float) is not a multiple of 8 and the compiler does not support __attribute__ ((aligned 8)). --- src/lisp.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lisp.h b/src/lisp.h index 8bd83a888c..f5d581a2f1 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2801,8 +2801,10 @@ XBUFFER_OBJFWD (lispfwd a) { double data; struct Lisp_Float *chain; + GCALIGNED_UNION_MEMBER } u; - } GCALIGNED_STRUCT; + }; +verify (GCALIGNED (struct Lisp_Float)); INLINE bool (FLOATP) (Lisp_Object x) -- 2.17.1