add AFL_USE_TSAN

This commit is contained in:
vanhauser-thc
2021-11-04 15:53:17 +01:00
parent 5e0e385e62
commit 6ce3d7fede
20 changed files with 106 additions and 59 deletions

View File

@ -42,10 +42,10 @@
#endif /* !__linux__ */
#ifndef likely
# define likely(x) __builtin_expect((!!(x)),1)
#define likely(x) __builtin_expect((!!(x)), 1)
#endif
#ifndef unlikely
# define unlikely(x) __builtin_expect((!!(x)),0)
#define unlikely(x) __builtin_expect((!!(x)), 0)
#endif
/* Change this value to tune the compare coverage */
@ -235,7 +235,12 @@ int strcmp(const char *str1, const char *str2) {
int strncmp(const char *str1, const char *str2, size_t len) {
if (unlikely(!__libc_strncmp)) { __libc_strncmp = dlsym(RTLD_NEXT, "strncmp"); }
if (unlikely(!__libc_strncmp)) {
__libc_strncmp = dlsym(RTLD_NEXT, "strncmp");
}
void *retaddr = __builtin_return_address(0);
if (__compcov_is_in_bound(retaddr) &&
@ -265,7 +270,12 @@ int strncmp(const char *str1, const char *str2, size_t len) {
int strcasecmp(const char *str1, const char *str2) {
if (unlikely(!__libc_strcasecmp)) { __libc_strncasecmp = dlsym(RTLD_NEXT, "strcasecmp"); }
if (unlikely(!__libc_strcasecmp)) {
__libc_strncasecmp = dlsym(RTLD_NEXT, "strcasecmp");
}
void *retaddr = __builtin_return_address(0);
if (__compcov_is_in_bound(retaddr) &&
@ -296,7 +306,12 @@ int strcasecmp(const char *str1, const char *str2) {
int strncasecmp(const char *str1, const char *str2, size_t len) {
if (unlikely(!__libc_strncasecmp)) { __libc_strncasecmp = dlsym(RTLD_NEXT, "strncasecmp"); }
if (unlikely(!__libc_strncasecmp)) {
__libc_strncasecmp = dlsym(RTLD_NEXT, "strncasecmp");
}
void *retaddr = __builtin_return_address(0);
if (__compcov_is_in_bound(retaddr) &&