[clang] [alpha.webkit.UncountedCallArgsChecker] Check the safety of the object argument in a member function call. (PR #81400)

Artem Dergachev via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 13 15:37:20 PST 2024


================
@@ -183,6 +196,22 @@ class UncountedCallArgsChecker
     Report->addRange(CallArg->getSourceRange());
     BR->emitReport(std::move(Report));
   }
+
+  void reportBugOnThis(const Expr *CallArg) const {
+    assert(CallArg);
+
+    SmallString<100> Buf;
+    llvm::raw_svector_ostream Os(Buf);
+
+    Os << "Call argument for 'this' parameter is uncounted and unsafe.";
----------------
haoNoQ wrote:

This is a constant string, no need to stream it, just put it straight into the `BugReport` constructor.

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


More information about the cfe-commits mailing list