[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


================
@@ -702,9 +702,17 @@ ProgramStateRef CStringChecker::CheckOverlap(CheckerContext &C,
       state->assume(svalBuilder.evalEQ(state, *firstLoc, *secondLoc));
 
   if (stateTrue && !stateFalse) {
-    // If the values are known to be equal, that's automatically an overlap.
-    emitOverlapBug(C, stateTrue, First.Expression, Second.Expression);
-    return nullptr;
+    if (Filter.CheckCStringBufferOverlap) {
+      // If the values are known to be equal, that's automatically an overlap.
+      emitOverlapBug(C, stateTrue, First.Expression, Second.Expression);
+      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 overlap checker
+    // is in alpha, lets just pretend nothing happened.
+    //C.addSink();
----------------
steakhal wrote:

Same about commented code.

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


More information about the cfe-commits mailing list