[compiler-rt] [compiler-rt][ASan] Add function moving annotations (PR #91702)
via llvm-commits
llvm-commits at lists.llvm.org
Fri May 10 00:22:32 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 95f208f97e709139c3ecbce552bcf1e34b9fcf12 42d3bfd7984cd326f1f8be41c0341952c8ee1db6 -- compiler-rt/test/asan/TestCases/move_container_annotations.cpp compiler-rt/include/sanitizer/common_interface_defs.h compiler-rt/lib/asan/asan_errors.cpp compiler-rt/lib/asan/asan_errors.h compiler-rt/lib/asan/asan_poisoning.cpp compiler-rt/lib/asan/asan_report.cpp compiler-rt/lib/asan/asan_report.h compiler-rt/lib/sanitizer_common/sanitizer_common_interface.inc compiler-rt/lib/sanitizer_common/sanitizer_interface_internal.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/lib/asan/asan_poisoning.cpp b/compiler-rt/lib/asan/asan_poisoning.cpp
index 03d74bb592..fd560bf04a 100644
--- a/compiler-rt/lib/asan/asan_poisoning.cpp
+++ b/compiler-rt/lib/asan/asan_poisoning.cpp
@@ -615,10 +615,11 @@ void __sanitizer_move_contiguous_container_annotations(
// Later we unpoison what is necessary.
PoisonShadow(new_internal_beg, new_storage_end - new_internal_beg,
kAsanContiguousContainerOOBMagic);
- if(new_internal_beg != new_storage_beg) {
+ if (new_internal_beg != new_storage_beg) {
uptr new_unpoisoned = *(u8 *)MemToShadow(new_external_beg);
if (new_unpoisoned > (new_storage_beg - new_external_beg)) {
- *(u8 *)MemToShadow(new_external_beg) = static_cast<u8>(new_storage_beg - new_external_beg);
+ *(u8 *)MemToShadow(new_external_beg) =
+ static_cast<u8>(new_storage_beg - new_external_beg);
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/91702
More information about the llvm-commits
mailing list