[compiler-rt] Preadv2 pwritev2 san reapply (PR #99089)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 16 12:38:28 PDT 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 81704f6946894538ee1649a88688f604939de7f0 1d4a17fe8163b37af24341652f2d742c509a87f3 --extensions cpp,h,inc -- compiler-rt/test/sanitizer_common/TestCases/Linux/preadv2.cpp 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 032b04a09a..f48705da0f 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -10271,13 +10271,15 @@ INTERCEPTOR(SSIZE_T, preadv2, int fd, __sanitizer_iovec *iov, int iovcnt,
   COMMON_INTERCEPTOR_ENTER(ctx, preadv2, fd, iov, iovcnt, offset, flags);
   COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd);
   SSIZE_T res = REAL(preadv2)(fd, iov, iovcnt, offset, flags);
-  if (res > 0) write_iovec(ctx, iov, iovcnt, res);
-  if (res >= 0 && fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd);
+  if (res > 0)
+    write_iovec(ctx, iov, iovcnt, res);
+  if (res >= 0 && fd >= 0)
+    COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd);
   return res;
 }
-#define INIT_PREADV2 COMMON_INTERCEPT_FUNCTION(preadv2)
+#  define INIT_PREADV2 COMMON_INTERCEPT_FUNCTION(preadv2)
 #else
-#define INIT_PREADV2
+#  define INIT_PREADV2
 #endif
 
 #if SANITIZER_INTERCEPT_PWRITEV2
@@ -10286,14 +10288,16 @@ INTERCEPTOR(SSIZE_T, pwritev2, int fd, __sanitizer_iovec *iov, int iovcnt,
   void *ctx;
   COMMON_INTERCEPTOR_ENTER(ctx, pwritev2, fd, iov, iovcnt, offset, flags);
   COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd);
-  if (fd >= 0) COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd);
+  if (fd >= 0)
+    COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd);
   SSIZE_T res = REAL(pwritev2)(fd, iov, iovcnt, offset, flags);
-  if (res > 0) read_iovec(ctx, iov, iovcnt, res);
+  if (res > 0)
+    read_iovec(ctx, iov, iovcnt, res);
   return res;
 }
-#define INIT_PWRITEV2 COMMON_INTERCEPT_FUNCTION(pwritev2)
+#  define INIT_PWRITEV2 COMMON_INTERCEPT_FUNCTION(pwritev2)
 #else
-#define INIT_PWRITEV2
+#  define INIT_PWRITEV2
 #endif
 
 #include "sanitizer_common_interceptors_netbsd_compat.inc"

``````````

</details>


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


More information about the llvm-commits mailing list