Skip to content

Commit

Permalink
Bug 1307590 - Check that clang supports the no_sanitize attribute r=mt
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Taubert committed Oct 6, 2016
1 parent 8abac4b commit a4969e6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/freebl/blapii.h
Expand Up @@ -44,10 +44,18 @@ SEC_END_PROTOS
#define HAVE_UNALIGNED_ACCESS 1
#endif

#if defined(__clang__) && defined(HAVE_UNALIGNED_ACCESS)
#if defined(__clang__)
#define HAVE_NO_SANITIZE_ATTR __has_attribute(no_sanitize)
#else
#define HAVE_NO_SANITIZE_ATTR 0
#endif

#if defined(HAVE_UNALIGNED_ACCESS) && HAVE_NO_SANITIZE_ATTR
#define NO_SANITIZE_ALIGNMENT __attribute__((no_sanitize("alignment")))
#else
#define NO_SANITIZE_ALIGNMENT
#endif

#undef HAVE_NO_SANITIZE_ATTR

#endif /* _BLAPII_H_ */

0 comments on commit a4969e6

Please sign in to comment.