• Paul Eggert's avatar
    Port to GCC 8 -fsanitize=undefined · a1c925fd
    Paul Eggert authored
    In GCC 8, gcc -fsanitize=undefined flags the undefined behavior
    that Emacs relies on in its XPNTR and XSYMBOL low-level functions.
    Disable undefined sanitization in these functions.  Although this
    disabling doesn’t suffice if DEFINE_KEY_OPS_AS_MACROS is true, it
    works for -fsanitize=undefined -DINLINING=0, which is good enough.
    * src/alloc.c (macro_PNTR_ADD): New macro.
    (PNTR_ADD): New function and macro.
    The function disables -fsanitize=undefined.
    (macro_XPNTR): Use it.
    * src/conf_post.h (ATTRIBUTE_NO_SANITIZE_UNDEFINED): New macro.
    * src/lisp.h (XSYMBOL): Disable -fsanitize=undefined.
    a1c925fd
alloc.c 207 KB