utils: Define ADDRESS_SANITIZER_EXCLUDE to exclude a function from sanitizer

This commit is contained in:
Martin Willi
2022-09-15 12:16:12 +02:00
committed by Tobias Brunner
parent 1866d33538
commit d840df185a
+10
View File
@@ -119,6 +119,16 @@ void utils_deinit();
# define __has_feature(x) 0
#endif
/**
* Address santizer support
*/
#if __has_feature(address_sanitizer) || \
(defined(__GNUC__) && defined(__SANITIZE_ADDRESS__))
# define ADDRESS_SANITIZER_EXCLUDE __attribute__((no_sanitize_address))
#else
# define ADDRESS_SANITIZER_EXCLUDE
#endif
/**
* Debug macro to follow control flow
*/