[llvm] WordPos should be less than BITWORDS_PER_ELEMENT (PR #142959)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 5 07:20:10 PDT 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 HEAD~1 HEAD --extensions h -- llvm/include/llvm/ADT/SparseBitVector.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/ADT/SparseBitVector.h b/llvm/include/llvm/ADT/SparseBitVector.h
index 3fec695c6..b353fe406 100644
--- a/llvm/include/llvm/ADT/SparseBitVector.h
+++ b/llvm/include/llvm/ADT/SparseBitVector.h
@@ -152,8 +152,8 @@ public:
unsigned WordPos = Curr / BITWORD_SIZE;
unsigned BitPos = Curr % BITWORD_SIZE;
BitWord Copy = Bits[WordPos];
- assert(WordPos < BITWORDS_PER_ELEMENT
- && "Word Position outside of element");
+ assert(WordPos < BITWORDS_PER_ELEMENT &&
+ "Word Position outside of element");
// Mask off previous bits.
Copy &= ~0UL << BitPos;
``````````
</details>
https://github.com/llvm/llvm-project/pull/142959
More information about the llvm-commits
mailing list