[llvm] [TySan] Fix crash in instrumentation with scalar TBAA tag missing offset (PR #172878)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 05:36:47 PDT 2026


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 origin/main HEAD --extensions cpp -- llvm/lib/Transforms/Instrumentation/TypeSanitizer.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/Instrumentation/TypeSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/TypeSanitizer.cpp
index 245f59788..f5841b57a 100644
--- a/llvm/lib/Transforms/Instrumentation/TypeSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/TypeSanitizer.cpp
@@ -352,7 +352,8 @@ bool TypeSanitizer::generateBaseTypeDescriptor(
     } else if (i == 1 && MD->getNumOperands() == 2) {
       // According to the LLVM language reference, the third operand for a
       // scalar tag is actually optional, its absence indicating an offset
-      // The third operand for a scalar tag is actually optional, its absence indicating an offset of zero.
+      // The third operand for a scalar tag is actually optional, its absence
+      // indicating an offset of zero.
       Offset = 0;
     } else {
       assert(false && "Malformed TBAA MD.");

``````````

</details>


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


More information about the llvm-commits mailing list