1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Tidy up UBSan detection

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
Dave Rodgman
2022-11-23 17:16:57 +00:00
parent 468df317bf
commit a6778013b4

View File

@ -78,12 +78,17 @@ extern void (*mbedtls_test_hook_test_fail)( const char * test, int line, const c
*
* This list is incomplete.
*/
#if defined(__has_feature)
#if __has_feature(undefined_behavior_sanitizer)
#define MBEDTLS_HAVE_UBSAN
#endif
#endif
#if (defined(__i386__) || defined(__amd64__) || defined( __x86_64__) \
|| defined(__ARM_FEATURE_UNALIGNED) \
|| defined(__aarch64__) \
|| defined(__ARM_ARCH_8__) || defined(__ARM_ARCH_8A__) || defined(__ARM_ARCH_8M__) \
|| defined(__ARM_ARCH_7A__)) \
&& (!(defined(__has_feature) && __has_feature(undefined_behavior_sanitizer)))
|| defined(__ARM_ARCH_7A__)) && !defined(MBEDTLS_HAVE_UBSAN)
#define MBEDTLS_ALLOW_UNALIGNED_ACCESS
#endif