]> git.eshelyaron.com Git - emacs.git/commitdiff
Port to 32-bit sparc64
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 20 Mar 2018 16:54:20 +0000 (09:54 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 20 Mar 2018 16:55:01 +0000 (09:55 -0700)
Problem reported by Ulrich Mueller; fix suggested by Eli Zaretskii
and Andreas Schwab (Bug#30855).
* src/alloc.c (mark_memory): Call mark_maybe_object only on
pointers that are properly aligned for Lisp_Object.

src/alloc.c

index f97b99c0f3122f32d47d4b4696afebb821d7e960..da01173fba21261512691b4c7fd2af85df781eab 100644 (file)
@@ -4981,7 +4981,11 @@ mark_memory (void *start, void *end)
   for (pp = start; (void *) pp < end; pp += GC_POINTER_ALIGNMENT)
     {
       mark_maybe_pointer (*(void **) pp);
-      mark_maybe_object (*(Lisp_Object *) pp);
+
+      verify (alignof (Lisp_Object) % GC_POINTER_ALIGNMENT == 0);
+      if (alignof (Lisp_Object) == GC_POINTER_ALIGNMENT
+         || (uintptr_t) pp % alignof (Lisp_Object) == 0)
+       mark_maybe_object (*(Lisp_Object *) pp);
     }
 }