[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

Daniel Marjamäki via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 20 02:20:49 PDT 2017


danielmarjamaki added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:337
+                                   const Expr *BlockBytes,
+                                   ProgramStateRef State);
   static ProgramStateRef CallocMem(CheckerContext &C, const CallExpr *CE,
----------------
Thanks for renaming the function I am happy now with that name. :-)

hmm.. if you have CheckerContext parameter already then ProgramStateRef parameter seems redundant. You should be able to use C.getState().

However looking at surrounding code it seems you can provide ProgramStateRef for consistency.

I don't have a strong opinion, but I would remove this State.



Repository:
  rL LLVM

https://reviews.llvm.org/D30771





More information about the cfe-commits mailing list