]> git.eshelyaron.com Git - emacs.git/commitdiff
(pure_alloc): Correct alignment for Lisp_Floats.
authorAndreas Schwab <schwab@suse.de>
Fri, 10 Jan 2003 20:09:44 +0000 (20:09 +0000)
committerAndreas Schwab <schwab@suse.de>
Fri, 10 Jan 2003 20:09:44 +0000 (20:09 +0000)
src/ChangeLog
src/alloc.c

index 1d12ff1dc1f4e336893a7ebbad1f0143e99981d5..7b5bb1767821e2be8ae72aa0554ba8171e6b7822 100644 (file)
@@ -1,3 +1,8 @@
+2003-01-10  Andreas Schwab  <schwab@suse.de>
+
+       * alloc.c (pure_alloc): Correct alignment for Lisp_Floats.
+       Reported by Berthold Gunreben <b.gunreben@web.de>.
+
 2002-12-09  Dave Love  <fx@gnu.org>
 
        * s/sol2-8.h: Removed.  (Not necessary.)
index b4989c4691b007c8f92dab0a19a1c0208aeeccfa..9497676560609e7cfba88f8647cbe75338a304d7 100644 (file)
@@ -1,5 +1,5 @@
 /* Storage allocation and gc for GNU Emacs Lisp interpreter.
-   Copyright (C) 1985, 86, 88, 93, 94, 95, 97, 98, 1999, 2000, 2001
+   Copyright (C) 1985, 86, 88, 93, 94, 95, 97, 98, 1999, 2000, 2001, 2003
       Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -3802,7 +3802,12 @@ pure_alloc (size, type)
 #else
       alignment = sizeof (struct Lisp_Float);
 #endif
-      pure_bytes_used = ALIGN (pure_bytes_used, alignment);
+      /* Make sure beg + pure_bytes_used is correctly aligned for a
+        Lisp_Float, which might need stricter alignment than
+        EMACS_INT.  */
+      pure_bytes_used
+       = (ALIGN ((EMACS_UINT) (beg + pure_bytes_used), alignment)
+          - (EMACS_UINT) beg);
     }
     
   nbytes = ALIGN (size, sizeof (EMACS_INT));