[compiler-rt] [compiler-rt] SetAlternateSignalStack using MAP_STACK on linux based … (PR #100905)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 27 16:07:55 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 745de9ef2071d9702343faf738b48381d83a0e00 f4d26f0c26c722a448ae42541ff8aff960a60e98 --extensions cpp -- compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
``````````

</details>

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

``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
index a811edd23e..f67195f6b1 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
@@ -84,9 +84,10 @@ bool DontDumpShadowMemory(uptr addr, uptr length) {
 }
 
 static void *MmapStackOrDie(uptr size, const char *mem_type) {
-#if SANITIZER_LINUX
-  // MAP_STACK on freebsd has a different meaning, on guard access the mapped region grows.
-  // unimplemented on netbsd still, could be enabled on openbsd if sanitizer is ever ported there.
+#  if SANITIZER_LINUX
+  // MAP_STACK on freebsd has a different meaning, on guard access the mapped
+  // region grows. unimplemented on netbsd still, could be enabled on openbsd if
+  // sanitizer is ever ported there.
   size = RoundUpTo(size, GetPageSizeCached());
   uptr res = MmapNamed(nullptr, size, PROT_READ | PROT_WRITE,
                        MAP_PRIVATE | MAP_STACK, mem_type);
@@ -95,9 +96,9 @@ static void *MmapStackOrDie(uptr size, const char *mem_type) {
     ReportMmapFailureAndDie(size, mem_type, "allocate", reserrno, true);
   IncreaseTotalMmap(size);
   return (void *)res;
-#else
+#  else
   return MmapOrDie(size, mem_type, true);
-#endif
+#  endif
 }
 
 static rlim_t getlim(int res) {

``````````

</details>


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


More information about the llvm-commits mailing list