https://github.com/zeyi2 updated 
https://github.com/llvm/llvm-project/pull/180351

>From 922c62cf52f4454bf99e819fcdac9af3a46ae2af Mon Sep 17 00:00:00 2001
From: mtx <[email protected]>
Date: Sat, 7 Feb 2026 22:26:21 +0800
Subject: [PATCH 1/2] [clang-tidy] Fix crash in
 readability-suspicious-call-argument on malformed config

---
 .../clang-tidy/readability/SuspiciousCallArgumentCheck.cpp | 6 +++++-
 clang-tools-extra/docs/ReleaseNotes.rst                    | 6 +++++-
 .../readability/suspicious-call-argument-option.cpp        | 7 +++++++
 .../checkers/readability/suspicious-call-argument.cpp      | 2 +-
 4 files changed, 18 insertions(+), 3 deletions(-)
 create mode 100644 
clang-tools-extra/test/clang-tidy/checkers/readability/suspicious-call-argument-option.cpp

diff --git 
a/clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp 
b/clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp
index e1a73aa47919e..576603a978e3f 100644
--- a/clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp
@@ -528,7 +528,11 @@ SuspiciousCallArgumentCheck::SuspiciousCallArgumentCheck(
   for (const StringRef Abbreviation : optutils::parseStringList(
            Options.get("Abbreviations", DefaultAbbreviations))) {
     const auto [Key, Value] = Abbreviation.split("=");
-    assert(!Key.empty() && !Value.empty());
+    if (Key.empty() || Value.empty()) {
+      configurationDiag("Invalid abbreviation configuration '%0', ignoring.")
+          << Abbreviation;
+      continue;
+    }
     AbbreviationDictionary.try_emplace(Key, Value.str());
   }
 }
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst 
b/clang-tools-extra/docs/ReleaseNotes.rst
index 0ad69f5fdc5aa..6b1e417a6f149 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -115,7 +115,7 @@ New checks
 
   Looks for functions returning ``std::[w|u8|u16|u32]string`` and suggests to
   change it to ``std::[...]string_view`` for performance reasons if possible.
-  
+
 - New :doc:`modernize-use-structured-binding
   <clang-tidy/checks/modernize/use-structured-binding>` check.
 
@@ -203,6 +203,10 @@ Changes in existing checks
   <clang-tidy/checks/readability/non-const-parameter>` check by avoiding false
   positives on parameters used in dependent expressions.
 
+- Improved :doc:`readability-suspicious-call-argument
+  <clang-tidy/checks/readability/suspicious-call-argument>` check by avoiding a
+  crash from malformed `Abbreviations` configuration.
+
 Removed checks
 ^^^^^^^^^^^^^^
 
diff --git 
a/clang-tools-extra/test/clang-tidy/checkers/readability/suspicious-call-argument-option.cpp
 
b/clang-tools-extra/test/clang-tidy/checkers/readability/suspicious-call-argument-option.cpp
new file mode 100644
index 0000000000000..7788feef8ce2c
--- /dev/null
+++ 
b/clang-tools-extra/test/clang-tidy/checkers/readability/suspicious-call-argument-option.cpp
@@ -0,0 +1,7 @@
+// RUN: %check_clang_tidy %s readability-suspicious-call-argument %t \
+// RUN: -config="{CheckOptions: 
{readability-suspicious-call-argument.Abbreviations: 'crash='}}" -- 
-std=c++11-or-later
+
+void f() {}
+// CHECK-MESSAGES: warning: Invalid abbreviation configuration 'crash=', 
ignoring.
+
+// TODO: Add testcases for other options
diff --git 
a/clang-tools-extra/test/clang-tidy/checkers/readability/suspicious-call-argument.cpp
 
b/clang-tools-extra/test/clang-tidy/checkers/readability/suspicious-call-argument.cpp
index 27db92be21f20..27c007ea278b2 100644
--- 
a/clang-tools-extra/test/clang-tidy/checkers/readability/suspicious-call-argument.cpp
+++ 
b/clang-tools-extra/test/clang-tidy/checkers/readability/suspicious-call-argument.cpp
@@ -1,4 +1,4 @@
-// RUN: %check_clang_tidy %s readability-suspicious-call-argument %t -- -- 
-std=c++11
+// RUN: %check_clang_tidy %s readability-suspicious-call-argument %t -- -- 
-std=c++11-or-later
 
 void foo_1(int aaaaaa, int bbbbbb) {}
 

>From 385aafe13890823b92fbfc32fe1ffd451055b717 Mon Sep 17 00:00:00 2001
From: mtx <[email protected]>
Date: Sat, 7 Feb 2026 22:52:38 +0800
Subject: [PATCH 2/2] Address review feedback [1/N]

---
 clang-tools-extra/docs/ReleaseNotes.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang-tools-extra/docs/ReleaseNotes.rst 
b/clang-tools-extra/docs/ReleaseNotes.rst
index 6b1e417a6f149..84c1269658bb8 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -205,7 +205,7 @@ Changes in existing checks
 
 - Improved :doc:`readability-suspicious-call-argument
   <clang-tidy/checks/readability/suspicious-call-argument>` check by avoiding a
-  crash from malformed `Abbreviations` configuration.
+  crash from invalid ``Abbreviations`` option.
 
 Removed checks
 ^^^^^^^^^^^^^^

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to