[llvm] [asan][x86] Abort instrumenting memintrinsics that target registers fs, gs (PR #129284)

via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 28 10:45:41 PST 2025


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 db4dd333d045b2b4eeb08d2c28fceb31cf0d59ac e8b23d5ef181e473204d95191eacb8f6669e78b1 --extensions cpp -- llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index ea360a1e62..85edcb1276 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -797,7 +797,7 @@ struct AddressSanitizer {
                                  bool IsWrite, size_t AccessSizeIndex,
                                  Value *SizeArgument, uint32_t Exp,
                                  RuntimeCallInserter &RTCI);
-  bool maybeIgnoreMemIntrinsic (MemIntrinsic *MI, const Triple &TargetTriple);
+  bool maybeIgnoreMemIntrinsic(MemIntrinsic *MI, const Triple &TargetTriple);
   void instrumentMemIntrinsic(MemIntrinsic *MI, RuntimeCallInserter &RTCI);
   Value *memToShadow(Value *Shadow, IRBuilder<> &IRB);
   bool suppressInstrumentationSiteForDebug(int &Instrumented);
@@ -1341,11 +1341,11 @@ Value *AddressSanitizer::memToShadow(Value *Shadow, IRBuilder<> &IRB) {
     return IRB.CreateAdd(Shadow, ShadowBase);
 }
 
-bool AddressSanitizer::maybeIgnoreMemIntrinsic (MemIntrinsic *MI, const Triple &TargetTriple)
-{
+bool AddressSanitizer::maybeIgnoreMemIntrinsic(MemIntrinsic *MI,
+                                               const Triple &TargetTriple) {
   // Ignore FS and GS registers to prevent miscompilation
-  if (MI->getDestAddressSpace() >= 256
-      && TargetTriple.getArch() == Triple::x86_64)
+  if (MI->getDestAddressSpace() >= 256 &&
+      TargetTriple.getArch() == Triple::x86_64)
     return true;
   return false;
 }

``````````

</details>


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


More information about the llvm-commits mailing list