[PATCH] D86445: [analyzer][RFC] Simplify MetadataSymbol representation and resolve a CStringChecker FIXME

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 24 06:39:23 PDT 2020


steakhal added inline comments.


================
Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:198
 /// SymbolMetadata - Represents path-dependent metadata about a specific region.
 ///  Metadata symbols remain live as long as they are marked as in use before
 ///  dead-symbol sweeping AND their associated regions are still alive.
----------------
martong wrote:
> I think the comments should be updated as well: remove "in use" and refer to the aliveness of the memregion.
Definitely, thanks.


================
Comment at: clang/test/Analysis/string.c:1544
+
 void memset7_char_array_nonnull() {
   char str[5] = "abcd";
----------------
martong wrote:
> It would make sense to split this into two. Only one of them should be in the `FIXMEs` section with the {{UNKNOWN}}. TRUE expectations could be moved out from the FIXMEs section.
This patch does not interfere with the test case below.

However, it would be nice to say that calling `strlen` on non-null-terminated strings is UB.
Thus expecting the `clang_analyzer_eval(strlen(str) >= 5);` to be `TRUE` does not make sense much IMO.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86445/new/

https://reviews.llvm.org/D86445



More information about the cfe-commits mailing list