Skip to content

Commit

Permalink
sanitizer: fix feature tests under clang
Browse files Browse the repository at this point in the history
While gcc defines __SANITIZE_ADDRESS__, clang requires more verbose
tests.  Add them to make the cleanup/security logic work correctly.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
  • Loading branch information
vapier committed Jan 25, 2024
1 parent af9a4e8 commit 80a83a8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions porting.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@
#endif

#undef PAX_UTILS_CLEANUP
#ifndef __SANITIZE_ADDRESS__
# ifdef __has_feature
# if __has_feature (address_sanitizer)
# define __SANITIZE_ADDRESS__ 1
# endif
# endif
#endif
/* LSAN (Leak Sanitizer) will complain about things we leak. */
#ifdef __SANITIZE_ADDRESS__
# define PAX_UTILS_CLEANUP 1
Expand Down

0 comments on commit 80a83a8

Please sign in to comment.