[compiler-rt] [compiler-rt] intercept the BSD timingsafe api (PR #79192)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 23 11:07:34 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 50d33c62ad8786400a712b01150f6decaf070782 7a6943d24cb299a247289f9155997187fb2f80a5 -- compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
index 9008837f87..f2ff4617bb 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -446,7 +446,8 @@ INTERCEPTOR(char*, textdomain, const char *domainname) {
 #define INIT_TEXTDOMAIN
 #endif
 
-#if SANITIZER_INTERCEPT_STRCMP || SANITIZER_INTERCEPT_MEMCMP || SANITIZER_INTERCEPT_TIMINGSAFE
+#if SANITIZER_INTERCEPT_STRCMP || SANITIZER_INTERCEPT_MEMCMP || \
+    SANITIZER_INTERCEPT_TIMINGSAFE
 static inline int CharCmpX(unsigned char c1, unsigned char c2) {
   return (c1 == c2) ? 0 : (c1 < c2) ? -1 : 1;
 }
@@ -881,11 +882,11 @@ INTERCEPTOR(int, timingsafe_bcmp, const void *a1, const void *a2, uptr size) {
   return MemcmpInterceptorCommon(ctx, REAL(bcmp), a1, a2, size);
 }
 
-#define INIT_TIMINGSAFE                            \
-  COMMON_INTERCEPT_FUNCTION(timingsafe_memcmp);    \
-  COMMON_INTERCEPT_FUNCTION(timingsafe_bcmp)
+#  define INIT_TIMINGSAFE                         \
+    COMMON_INTERCEPT_FUNCTION(timingsafe_memcmp); \
+    COMMON_INTERCEPT_FUNCTION(timingsafe_bcmp)
 #else
-#define INIT_TIMINGSAFE
+#  define INIT_TIMINGSAFE
 #endif
 
 #if SANITIZER_INTERCEPT_MEMCHR

``````````

</details>


https://github.com/llvm/llvm-project/pull/79192


More information about the llvm-commits mailing list