# HG changeset patch # User Jim Blandy # Date 730468179 0 # Node ID def7b9c649351b0654453a692fb59b52707836c0 # Parent 1045deef809f3d4e0e19601dd545b2ea4321d451 * alloc.c (make_pure_float): Assure that PUREBEG + pureptr is aligned, not pureptr itself. diff -r 1045deef809f -r def7b9c64935 src/alloc.c --- a/src/alloc.c Tue Feb 23 07:27:39 1993 +0000 +++ b/src/alloc.c Tue Feb 23 11:49:39 1993 +0000 @@ -991,22 +991,27 @@ double num; { register Lisp_Object new; - int alignment; - /* Make sure that pureptr is aligned on at least a sizeof (double) - boundary. Some architectures (like the sparc) require this, and - I suspect that floats are rare enough that it's no tragedy for - those that do. */ + /* Make sure that PUREBEG + pureptr is aligned on at least a sizeof + (double) boundary. Some architectures (like the sparc) require + this, and I suspect that floats are rare enough that it's no + tragedy for those that do. */ + { + int alignment; + char *p = PUREBEG + pureptr; + #ifdef __GNUC__ #if __GNUC__ >= 2 - alignment = __alignof (struct Lisp_Float); + alignment = __alignof (struct Lisp_Float); #else - alignment = sizeof (struct Lisp_Float); + alignment = sizeof (struct Lisp_Float); #endif #else - alignment = sizeof (struct Lisp_Float); + alignment = sizeof (struct Lisp_Float); #endif - pureptr = (pureptr + alignment - 1) & - alignment; + p = (char *) (((unsigned long) p + alignment - 1) & - alignment); + pureptr = p - PUREBEG; + } if (pureptr + sizeof (struct Lisp_Float) > PURESIZE) error ("Pure Lisp storage exhausted");