[clang] [analyzer] Splitting TaintPropagation checker into reporting and mode… (PR #98157)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 9 06:32:57 PDT 2024


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 a77d3ea310c61cf59c1146895b2d51fe014eb0a9 fdd19cf4ea888fa48994ff3935d61d64a8d58c9d -- clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
index 578db0dcea..465e7daa18 100644
--- a/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
@@ -394,8 +394,9 @@ public:
 
   bool isTaintReporterCheckerEnabled = false;
   CheckerNameRef reporterCheckerName;
+
 private:
-  mutable std::unique_ptr<BugType>  BT;
+  mutable std::unique_ptr<BugType> BT;
 
   bool checkUncontrolledFormatString(const CallEvent &Call,
                                      CheckerContext &C) const;
@@ -1046,8 +1047,8 @@ bool GenericTaintChecker::generateReportIfTainted(const Expr *E, StringRef Msg,
 
   // Generate diagnostic.
   if (!BT)
-    BT.reset(new BugType(
-          reporterCheckerName, "Use of Untrusted Data", categories::TaintedData));
+    BT.reset(new BugType(reporterCheckerName, "Use of Untrusted Data",
+                         categories::TaintedData));
   static CheckerProgramPointTag Tag(reporterCheckerName, Msg);
   if (ExplodedNode *N = C.generateNonFatalErrorNode(C.getState(), &Tag)) {
     auto report = std::make_unique<PathSensitiveBugReport>(*BT, Msg, N);

``````````

</details>


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


More information about the cfe-commits mailing list