[PATCH] D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 18 02:41:31 PDT 2020


balazske added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:191
+  ///   * a list of branches - a list of list of ranges -
+  ///     i.e. a list of lists of lists of segments,
+  ///   * a list of argument constraints, that must be true on every branch.
----------------
martong wrote:
> martong wrote:
> > Szelethus wrote:
> > > I think that is a rather poor example to help understand what `list of list of ranges` means :) -- Could you try to find something better?
> > Yeah, that part definitely should be reworded.
> I added an example with `isalpha`.
The "branches" are the structures that define relations between arguments and return values? This could be included in the description.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:112
                                   const Summary &Summary) const = 0;
+    virtual ValueConstraintPtr negate() const {
+      llvm_unreachable("Not implemented");
----------------
Is it better done with `= 0`?


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:297
+
+  void ReportBug(const CallEvent &Call, ExplodedNode *N, CheckerContext &C) const {
+    if (!ChecksEnabled[CK_StdCLibraryFunctionArgsChecker])
----------------
This should be called `reportBug`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73898





More information about the cfe-commits mailing list