]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp.h (USE_STACK_STRING): Now true only if USE_STACK CONS.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 9 Oct 2014 06:54:10 +0000 (23:54 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 9 Oct 2014 06:54:10 +0000 (23:54 -0700)
On x86 platforms this works around GCC bug 63495
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63495>,
and more generally should fix a portability problem in Emacs.
Problem reported by Stefan Monnier in:
http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00261.html

src/ChangeLog
src/lisp.h

index e01c70f3dce6ebb08235bd3c46e9ed94e87a617b..a38df05518d2f14378d99c45fad4d9d0213e8fd7 100644 (file)
@@ -1,3 +1,12 @@
+2014-10-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * lisp.h (USE_STACK_STRING): Now true only if USE_STACK CONS.
+       On x86 platforms this works around GCC bug 63495
+       <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63495>,
+       and more generally should fix a portability problem in Emacs.
+       Problem reported by Stefan Monnier in:
+       http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00261.html
+
 2014-10-08  Leo Liu  <sdl.web@gmail.com>
 
        Enhance terpri to allow conditionally output a newline.  (Bug#18652)
index 0425744b30142783660fa7803c1f0d9d7421a3e4..9e4cc5fdc53aa5fa7326ac05b9acf2d7f4410ab3 100644 (file)
@@ -4615,13 +4615,16 @@ union Aligned_String
   double d; intmax_t i; void *p;
 };
 
-/* True for stack-based cons and string implementations.  */
+/* True for stack-based cons and string implementations, respectively.
+   Use stack-based strings only if stack-based cons also works.
+   Otherwise, STACK_CONS would create heap-based cons cells that
+   could point to stack-based strings, which is a no-no.  */
 
 enum
   {
     USE_STACK_CONS = (USE_STACK_LISP_OBJECTS
                      && alignof (union Aligned_Cons) % GCALIGNMENT == 0),
-    USE_STACK_STRING = (USE_STACK_LISP_OBJECTS
+    USE_STACK_STRING = (USE_STACK_CONS
                        && alignof (union Aligned_String) % GCALIGNMENT == 0)
   };