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.
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);
}
}