[PATCH] D48831: alpha.unix.cstring.OutOfBounds checker enable/disable fix

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 2 16:38:28 PDT 2018


NoQ added a comment.

Uhm, so we had an alpha checker enabled all along? Thanks for patching this up!



================
Comment at: lib/StaticAnalyzer/Checkers/CStringChecker.cpp:308
     // These checks are either enabled by the CString out-of-bounds checker
-    // explicitly or the "basic" CStringNullArg checker support that Malloc
-    // checker enables.
-    assert(Filter.CheckCStringOutOfBounds || Filter.CheckCStringNullArg);
+    // explicitly or implicitly by the  Malloc checker.
+    // In the latter case we only do modeling but do not emit warning.
----------------
Accidental double space.


================
Comment at: lib/StaticAnalyzer/Checkers/CStringChecker.cpp:311
+    if (!Filter.CheckCStringOutOfBounds)
+      return StOutBound;
 
----------------
Could we preserve the other portion of the assertion on this branch? I.e., `assert(Filter.CheckCStringNullArg)`.

Additionally, do you really want to continue analysis on this path? Maybe `return nullptr` to sink?


Repository:
  rC Clang

https://reviews.llvm.org/D48831





More information about the cfe-commits mailing list