[PATCH] D75063: [analyzer] StdLibraryFunctionsChecker: Add NotNull Arg Constraint

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 18 07:36:20 PDT 2020


Szelethus accepted this revision.
Szelethus added a comment.

LGTM! Please address the nits before commiting, but there is no need for another round of reviews. :)

edit: from my end, that is.



================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:175
+    using ValueConstraint::ValueConstraint;
+    bool CannotBeNull = true;
+
----------------
martong wrote:
> Szelethus wrote:
> > What does this do? Is it ever used in the patch?
> Yes, it is used. We use it in `apply` the value is passed to `assume`.
> And in `negate` we flip the value.
Forgot my eyes in the office. Woops. I would still prefer a line of comment here :)


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:889-890
                           Read(LongLongTy, LongLongMax)}},
       {"fread", Summaries{Fread()}},
-      {"fwrite", Summaries{Fread()}},
+      {"fwrite", Summaries{Fwrite()}},
       // getline()-like functions either fail or read at least the delimiter.
----------------
Not super relevant to this specific revision, but shouldn't we leave these to `StreamChecker`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75063





More information about the cfe-commits mailing list