We perform weird pointer arithmetic due to the layout of Lisp_Objects
holding symbols. ASan/UBSan warns about that (Bug#42530). Suppress
the warnings by performing the arithmetic on integer types and casting
back to pointers.
* src/alloc.c (mark_maybe_object, mark_memory): Temporarily cast
pointer to 'intptr_t'.
break;
}
- void *po = (char *) XLP (obj) + (offset - LISP_WORD_TAG (type_tag));
+ void *po = (char *) ((intptr_t) (char *) XLP (obj)
+ + (offset - LISP_WORD_TAG (type_tag)));
/* If the pointer is in the dump image and the dump has a record
of the object starting at the place where the pointer points, we
On a host with 32-bit pointers and 64-bit Lisp_Objects,
a Lisp_Object might be split into registers saved into
non-adjacent words and P might be the low-order word's value. */
- p += (intptr_t) lispsym;
+ p = (char *) ((intptr_t) p + (intptr_t) lispsym);
mark_maybe_pointer (p);
verify (alignof (Lisp_Object) % GC_POINTER_ALIGNMENT == 0);