[PATCH] D43879: Cleanup in sanitizer_common_interceptors.inc
Kamil Rytarowski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 28 10:03:47 PST 2018
krytarowski created this revision.
krytarowski added reviewers: vitalybuka, joerg.
krytarowski added a project: Sanitizers.
Herald added subscribers: llvm-commits, kubamracek.
Switch a `#if SANITIZER_NETBSD` block to
`COMMON_MAYBE_INTERCEPT_NETBSD_ALIAS*`.
No functional change intended.
Requested by <vitalybuka>
Sponsored by <The NetBSD Foundation>
Repository:
rL LLVM
https://reviews.llvm.org/D43879
Files:
lib/sanitizer_common/sanitizer_common_interceptors.inc
Index: lib/sanitizer_common/sanitizer_common_interceptors.inc
===================================================================
--- lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -4053,8 +4053,16 @@
ALIAS(WRAPPER_NAME(pthread_mutex_unlock));
INTERCEPTOR(int, __libc_thr_setcancelstate, int state, int *oldstate) \
ALIAS(WRAPPER_NAME(pthread_setcancelstate));
+# define COMMON_MAYBE_INTERCEPT_NETBSD_ALIAS(func) \
+ COMMON_INTERCEPT_FUNCTION(__libc_##func)
+# define COMMON_MAYBE_INTERCEPT_NETBSD_ALIAS_THR(func) \
+ COMMON_INTERCEPT_FUNCTION(__libc_thr_##func)
+#else
+# define COMMON_MAYBE_INTERCEPT_NETBSD_ALIAS(func)
+# define COMMON_MAYBE_INTERCEPT_NETBSD_ALIAS_THR(func)
#endif
+
#if SANITIZER_INTERCEPT_GETMNTENT || SANITIZER_INTERCEPT_GETMNTENT_R
static void write_mntent(void *ctx, __sanitizer_mntent *mnt) {
COMMON_INTERCEPTOR_WRITE_RANGE(ctx, mnt, sizeof(*mnt));
@@ -7259,11 +7267,9 @@
INIT_PROTOENT;
INIT_NETENT;
-#if SANITIZER_NETBSD
- COMMON_INTERCEPT_FUNCTION(__libc_mutex_lock);
- COMMON_INTERCEPT_FUNCTION(__libc_mutex_unlock);
- COMMON_INTERCEPT_FUNCTION(__libc_thr_setcancelstate);
-#endif
+ COMMON_MAYBE_INTERCEPT_NETBSD_ALIAS(mutex_lock);
+ COMMON_MAYBE_INTERCEPT_NETBSD_ALIAS(mutex_unlock);
+ COMMON_MAYBE_INTERCEPT_NETBSD_ALIAS_THR(setcancelstate);
INIT___PRINTF_CHK;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43879.136320.patch
Type: text/x-patch
Size: 1415 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180228/b3786af9/attachment.bin>
More information about the llvm-commits
mailing list