[clang] [analyzer] Untangle subcheckers of CStringChecker (PR #113312)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 24 21:42:44 PDT 2024


================
@@ -579,8 +579,14 @@ ProgramStateRef CStringChecker::CheckLocation(CheckerContext &C,
     // These checks are either enabled by the CString out-of-bounds checker
     // explicitly or implicitly by the Malloc checker.
     // In the latter case we only do modeling but do not emit warning.
-    if (!Filter.CheckCStringOutOfBounds)
-      return nullptr;
+    // FIXME: We detected a fatal error here, we should stop analysis even if we
+    // chose not to emit a report here. However, as long as our out-of-bounds
+    // checker is in alpha, lets just pretend nothing happened.
+    if (!Filter.CheckCStringOutOfBounds) {
+      //C.addSink();
----------------
steakhal wrote:

Commented out code is a code smell. Use the comment "We should not sink execution here."

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


More information about the cfe-commits mailing list