diff options
| author | Paul Eggert | 2018-06-08 23:53:58 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-06-08 23:54:50 -0700 |
| commit | 49ba7544c2ebbcfc50ce1e02add6bd739f475c4c (patch) | |
| tree | 69b5814b49dff5c92492ce068492e44e74c51b7e /src | |
| parent | c67befd662571a822f3183c114ce3b1ad02e0ed9 (diff) | |
| download | emacs-49ba7544c2ebbcfc50ce1e02add6bd739f475c4c.tar.gz emacs-49ba7544c2ebbcfc50ce1e02add6bd739f475c4c.zip | |
Remove AddressSanitizer bug workaround
This workaround no longer appears to be needed.
* src/alloc.c (USE_ALIGNED_ALLOC): Don’t leave undefined
merely because ADDRESS_SANITIZER is defined, as that bug
in -fsanitize=address appears to have been fixed. See:
https://github.com/google/sanitizers/issues/337
* src/conf_post.h (vfork): Improve comment.
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 9 | ||||
| -rw-r--r-- | src/conf_post.h | 3 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/alloc.c b/src/alloc.c index 4186347440c..f600c89ae2c 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -1146,11 +1146,10 @@ lisp_free (void *block) | |||
| 1146 | verify (POWER_OF_2 (BLOCK_ALIGN)); | 1146 | verify (POWER_OF_2 (BLOCK_ALIGN)); |
| 1147 | 1147 | ||
| 1148 | /* Use aligned_alloc if it or a simple substitute is available. | 1148 | /* Use aligned_alloc if it or a simple substitute is available. |
| 1149 | Address sanitization breaks aligned allocation, as of gcc 4.8.2 and | 1149 | Aligned allocation is incompatible with unexmacosx.c, so don't use |
| 1150 | clang 3.3 anyway. Aligned allocation is incompatible with | 1150 | it on Darwin unless CANNOT_DUMP. */ |
| 1151 | unexmacosx.c, so don't use it on Darwin. */ | ||
| 1152 | 1151 | ||
| 1153 | #if ! ADDRESS_SANITIZER && !defined DARWIN_OS | 1152 | #if !defined DARWIN_OS || defined CANNOT_DUMP |
| 1154 | # if (defined HAVE_ALIGNED_ALLOC \ | 1153 | # if (defined HAVE_ALIGNED_ALLOC \ |
| 1155 | || (defined HYBRID_MALLOC \ | 1154 | || (defined HYBRID_MALLOC \ |
| 1156 | ? defined HAVE_POSIX_MEMALIGN \ | 1155 | ? defined HAVE_POSIX_MEMALIGN \ |
| @@ -1446,7 +1445,7 @@ laligned (void *p, size_t size) | |||
| 1446 | static void * | 1445 | static void * |
| 1447 | lmalloc (size_t size) | 1446 | lmalloc (size_t size) |
| 1448 | { | 1447 | { |
| 1449 | #if USE_ALIGNED_ALLOC | 1448 | #ifdef USE_ALIGNED_ALLOC |
| 1450 | if (! MALLOC_IS_GC_ALIGNED && size % GCALIGNMENT == 0) | 1449 | if (! MALLOC_IS_GC_ALIGNED && size % GCALIGNMENT == 0) |
| 1451 | return aligned_alloc (GCALIGNMENT, size); | 1450 | return aligned_alloc (GCALIGNMENT, size); |
| 1452 | #endif | 1451 | #endif |
diff --git a/src/conf_post.h b/src/conf_post.h index bf2cfc4f05f..30f3b953056 100644 --- a/src/conf_post.h +++ b/src/conf_post.h | |||
| @@ -350,7 +350,8 @@ extern int emacs_setenv_TZ (char const *); | |||
| 350 | # define ATTRIBUTE_NO_SANITIZE_UNDEFINED | 350 | # define ATTRIBUTE_NO_SANITIZE_UNDEFINED |
| 351 | #endif | 351 | #endif |
| 352 | 352 | ||
| 353 | /* gcc -fsanitize=address does not work with vfork in Fedora 25 x86-64. | 353 | /* gcc -fsanitize=address does not work with vfork in Fedora 28 x86-64. See: |
| 354 | https://lists.gnu.org/r/emacs-devel/2017-05/msg00464.html | ||
| 354 | For now, assume that this problem occurs on all platforms. */ | 355 | For now, assume that this problem occurs on all platforms. */ |
| 355 | #if ADDRESS_SANITIZER && !defined vfork | 356 | #if ADDRESS_SANITIZER && !defined vfork |
| 356 | # define vfork fork | 357 | # define vfork fork |