diff options
Diffstat (limited to 'util.h')
| -rw-r--r-- | util.h | 33 |
1 files changed, 2 insertions, 31 deletions
@@ -9,7 +9,6 @@ #ifndef _UTIL_H_ #define _UTIL_H_ -#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> @@ -106,40 +105,12 @@ static inline int is_android(void) #endif } -static inline bool compiled_with_asan(void) -{ -#if defined(__SANITIZE_ADDRESS__) - /* For gcc. */ - return true; -#elif defined(__has_feature) - /* For clang. */ - return __has_feature(address_sanitizer) || - __has_feature(hwaddress_sanitizer); -#else - return false; -#endif -} - void __asan_init(void) attribute_weak; void __hwasan_init(void) attribute_weak; -static inline bool running_with_asan(void) +static inline int running_with_asan(void) { - /* - * There are some configurations under which ASan needs a dynamic (as - * opposed to compile-time) test. Some Android processes that start - * before /data is mounted run with non-instrumented libminijail.so, so - * the symbol-sniffing code must be present to make the right decision. - */ - return compiled_with_asan() || &__asan_init != 0 || &__hwasan_init != 0; -} - -static inline bool debug_logging_allowed(void) { -#if defined(ALLOW_DEBUG_LOGGING) - return true; -#else - return false; -#endif + return &__asan_init != 0 || &__hwasan_init != 0; } int lookup_syscall(const char *name); |
