1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-19 01:10:57 -08:00

Avoid compiler warning in igc.c

* src/igc.c (fix_weak_ref): Avoid compiler warning about
dereferencing type-punned pointer, which breaks strict-aliasing
rules.
This commit is contained in:
Eli Zaretskii 2024-04-26 10:24:36 +03:00
parent 74635ca430
commit 10dde7db29

View file

@ -1034,7 +1034,9 @@ fix_weak_ref (mps_ss_t ss, struct Lisp_Weak_Ref *wref)
{
MPS_SCAN_BEGIN (ss)
{
const mps_word_t tagged_word = *(mps_word_t *)&wref->ref;
/* FIXME: The below explicitly assumes Lisp_Object is of the same
width as mps_word_t! */
const mps_word_t tagged_word = (ptrdiff_t) igc_weak_ref_deref (wref);
const enum Lisp_Type tag = tagged_word & IGC_TAG_MASK;
switch (tag)