[clang] [clang][RISCV] Fix the condition of checking signature in getIndex (PR #67403)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 14 11:16:24 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Jianjian Guan (jacquesguan)

<details>
<summary>Changes</summary>

The current condition causes assert failing if try to add a new vendor vector file which only contains the same type signature.

---
Full diff: https://github.com/llvm/llvm-project/pull/67403.diff


1 Files Affected:

- (modified) clang/utils/TableGen/RISCVVEmitter.cpp (+1-1) 


``````````diff
diff --git a/clang/utils/TableGen/RISCVVEmitter.cpp b/clang/utils/TableGen/RISCVVEmitter.cpp
index 41025926058ed..c08e48b3f44df 100644
--- a/clang/utils/TableGen/RISCVVEmitter.cpp
+++ b/clang/utils/TableGen/RISCVVEmitter.cpp
@@ -290,7 +290,7 @@ unsigned SemaSignatureTable::getIndex(ArrayRef<PrototypeDescriptor> Signature) {
     return 0;
 
   // Checking Signature already in table or not.
-  if (Signature.size() < SignatureTable.size()) {
+  if (Signature.size() <= SignatureTable.size()) {
     size_t Bound = SignatureTable.size() - Signature.size() + 1;
     for (size_t Index = 0; Index < Bound; ++Index) {
       if (equal(Signature.begin(), Signature.end(),

``````````

</details>


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


More information about the cfe-commits mailing list