[PATCH] D72035: [analyzer][NFC] Use CallEvent checker callback in GenericTaintChecker

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 7 05:00:45 PST 2020


Szelethus added a comment.

Hmm, have you branched off of D71524 <https://reviews.llvm.org/D71524>? If so, this patch should definitely land first.



================
Comment at: clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp:165
   /// Given a pointer argument, return the value it points to.
-  static Optional<SVal> getPointedToSVal(CheckerContext &C, const Expr *Arg);
+  static Optional<SVal> getPointeeOf(CheckerContext &C, const Expr *Arg);
 
----------------
Nice!


================
Comment at: clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp:385
+unsigned getNumArgs(const CallEvent &Call) {
+  return Call.getNumArgs() + static_cast<unsigned>(isa<CXXInstanceCall>(Call));
 }
----------------
NoQ wrote:
> steakhal wrote:
> > I'm not sure why should we adjust (//workaround//) the number of arguments of `CXXInstanceCall`s calls, can someone explain it to me?
> > 
> > The same question raised for `getArg` too. 
> Remove this :)
> 
> I think this is about this inconsistency with operator calls where one of {decl, expr} treats `this` as an argument, but the other doesn't. `CallEvent` automatically accounts for that (see `getAdjustedParameterIndex()` and `getASTArgumentIndex()` as they're overridden in various sub-classes of `CallEvent`).
I have some thoughts about this here: D71524#1859435. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72035





More information about the cfe-commits mailing list