[compiler-rt] [hwasan] Fixing false invalid-free with disabled tagging (PR #67169)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 22 10:56:19 PDT 2023


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 b38f31aeb0d1c3a97306efa8e5161171f07aa44c 76a5c93f2d950b420b5bc8318712073ecbe4b679 -- compiler-rt/test/hwasan/TestCases/enable-disable.c compiler-rt/lib/hwasan/hwasan_allocator.cpp
``````````

</details>

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

``````````diff
diff --git a/compiler-rt/test/hwasan/TestCases/enable-disable.c b/compiler-rt/test/hwasan/TestCases/enable-disable.c
index d686b6bdc62f..c6f0b7a77fdc 100644
--- a/compiler-rt/test/hwasan/TestCases/enable-disable.c
+++ b/compiler-rt/test/hwasan/TestCases/enable-disable.c
@@ -1,20 +1,20 @@
 // RUN: %clang_hwasan -O1 %s -o %t && %run %t 2>&1
 
-#include <stdlib.h>
-#include <stdio.h>
 #include <sanitizer/hwasan_interface.h>
+#include <stdio.h>
+#include <stdlib.h>
 
 #define SZ 1000
-void * x[SZ];
+void *x[SZ];
 
 int main() {
   __hwasan_enable_allocator_tagging();
   for (unsigned i = 0; i < SZ; ++i)
     x[i] = malloc(10);
-  for (unsigned i = 0; i < SZ; ++i) 
+  for (unsigned i = 0; i < SZ; ++i)
     free(x[i]);
   __hwasan_disable_allocator_tagging();
-  
+
   for (unsigned i = 0; i < SZ; ++i)
     x[i] = malloc(10);
   for (unsigned i = 0; i < SZ; ++i)

``````````

</details>


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


More information about the llvm-commits mailing list