summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2025-07-02 10:51:22 -0400
committerTavian Barnes <tavianator@tavianator.com>2025-07-04 08:22:18 -0400
commit19b4d6bb428a94359f0aca524867a8066afe8b5c (patch)
tree7103399545f281eec646bff379cfab786a499211 /src
parent458c99ba19ccafb637f25bfb7f5a1de2dd84c6dc (diff)
downloadbfs-19b4d6bb428a94359f0aca524867a8066afe8b5c.tar.xz
build: Add support for TySan
There are some false positives, so it's not added to distcheck yet.
Diffstat (limited to 'src')
-rw-r--r--src/bfs.h5
-rw-r--r--src/prelude.h3
2 files changed, 7 insertions, 1 deletions
diff --git a/src/bfs.h b/src/bfs.h
index 3cee727..70a7282 100644
--- a/src/bfs.h
+++ b/src/bfs.h
@@ -202,7 +202,10 @@ extern const char bfs_ldlibs[];
* Disabled on TSan due to https://github.com/google/sanitizers/issues/342.
*/
#ifndef BFS_USE_TARGET_CLONES
-# if __has_attribute(target_clones) && (__GLIBC__ || __FreeBSD__) && !__SANITIZE_THREAD__
+# if __has_attribute(target_clones) \
+ && (__GLIBC__ || __FreeBSD__) \
+ && !__SANITIZE_THREAD__ \
+ && !__SANITIZE_TYPE__
# define BFS_USE_TARGET_CLONES true
# else
# define BFS_USE_TARGET_CLONES false
diff --git a/src/prelude.h b/src/prelude.h
index de89a6c..3b1c4e5 100644
--- a/src/prelude.h
+++ b/src/prelude.h
@@ -126,5 +126,8 @@
#if __has_feature(thread_sanitizer) && !defined(__SANITIZE_THREAD__)
# define __SANITIZE_THREAD__ true
#endif
+#if __has_feature(type_sanitizer) && !defined(__SANITIZE_TYPE__)
+# define __SANITIZE_TYPE__ true
+#endif
#endif // BFS_PRELUDE_H