diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lisp.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/lisp.h b/src/lisp.h index 56545b70946..eb31ba209a6 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -902,12 +902,15 @@ INLINE struct Lisp_Symbol * | |||
| 902 | { | 902 | { |
| 903 | #if USE_LSB_TAG | 903 | #if USE_LSB_TAG |
| 904 | return lisp_h_XSYMBOL (a); | 904 | return lisp_h_XSYMBOL (a); |
| 905 | #elif defined __CHKP__ | ||
| 906 | # error "pointer-checking not supported with wide integers" | ||
| 907 | #else | 905 | #else |
| 908 | eassert (SYMBOLP (a)); | 906 | eassert (SYMBOLP (a)); |
| 909 | intptr_t i = (intptr_t) XUNTAG (a, Lisp_Symbol); | 907 | intptr_t i = (intptr_t) XUNTAG (a, Lisp_Symbol); |
| 910 | void *p = (char *) lispsym + i; | 908 | void *p = (char *) lispsym + i; |
| 909 | # ifdef __CHKP__ | ||
| 910 | /* Bypass pointer checking. Although this could be improved it is | ||
| 911 | probably not worth the trouble. */ | ||
| 912 | p = __builtin___bnd_set_ptr_bounds (p, sizeof (struct Lisp_Symbol)); | ||
| 913 | # endif | ||
| 911 | return p; | 914 | return p; |
| 912 | #endif | 915 | #endif |
| 913 | } | 916 | } |
| @@ -916,9 +919,11 @@ INLINE Lisp_Object | |||
| 916 | make_lisp_symbol (struct Lisp_Symbol *sym) | 919 | make_lisp_symbol (struct Lisp_Symbol *sym) |
| 917 | { | 920 | { |
| 918 | #ifdef __CHKP__ | 921 | #ifdef __CHKP__ |
| 919 | /* Although this should use '__builtin___bnd_narrow_ptr_bounds (sym, | 922 | /* Although '__builtin___bnd_narrow_ptr_bounds (sym, sym, sizeof *sym)' |
| 920 | sym, sizeof *sym)', that would run afoul of GCC bug 83251 | 923 | should be more efficient, it runs afoul of GCC bug 83251 |
| 921 | <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83251>. */ | 924 | <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83251>. |
| 925 | Also, attempting to call __builtin___bnd_chk_ptr_bounds (sym, sizeof *sym) | ||
| 926 | here seems to trigger a GCC bug, as yet undiagnosed. */ | ||
| 922 | char *addr = __builtin___bnd_set_ptr_bounds (sym, sizeof *sym); | 927 | char *addr = __builtin___bnd_set_ptr_bounds (sym, sizeof *sym); |
| 923 | char *symoffset = addr - (intptr_t) lispsym; | 928 | char *symoffset = addr - (intptr_t) lispsym; |
| 924 | #else | 929 | #else |