[llvm] [compiler-rt] [msan][aarch64] Fix cleanup of unused part of overflow area (PR #72722)

via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 17 16:05:10 PST 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 813aaf39f94609a46f38f1e3a15a763a2cc0d2cf 6d1d61d01f1ed01bc0e6ac2ad59e7c1c92c48e2e -- compiler-rt/test/msan/vararg_shadow.cpp llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
index bcafbf3085..170e267356 100644
--- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -4696,7 +4696,8 @@ struct VarArgHelperBase : public VarArgHelper {
                               "_msarg_va_o");
   }
 
-  void CleanUnusedTLS(IRBuilder<> &IRB, Value *ShadowBase, unsigned BaseOffset) {
+  void CleanUnusedTLS(IRBuilder<> &IRB, Value *ShadowBase,
+                      unsigned BaseOffset) {
     // The tails of __msan_va_arg_tls is not large enough to fit full
     // value shadow, but it will be copied to backup anyway. Make it
     // clean.
@@ -4705,7 +4706,7 @@ struct VarArgHelperBase : public VarArgHelper {
     Value *TailSize =
         ConstantInt::getSigned(IRB.getInt32Ty(), kParamTLSSize - BaseOffset);
     IRB.CreateMemSet(ShadowBase, ConstantInt::getNullValue(IRB.getInt8Ty()),
-                      TailSize, Align(8));
+                     TailSize, Align(8));
   }
 
   void unpoisonVAListTagForInst(IntrinsicInst &I) {
@@ -4863,7 +4864,7 @@ struct VarArgAMD64Helper : public VarArgHelperBase {
           if (OverflowOffset > kParamTLSSize) {
             // We have no space to copy shadow there.
             CleanUnusedTLS(IRB, ShadowBase, BaseOffset);
-            continue; 
+            continue;
           }
         }
         // Take fixed arguments into account for GpOffset and FpOffset,

``````````

</details>


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


More information about the llvm-commits mailing list