[PATCH] D45071: [analyzer] Track null or undef values through pointer arithmetic.

George Karpenkov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 30 10:41:21 PDT 2018


george.karpenkov accepted this revision.
george.karpenkov added a comment.
This revision is now accepted and ready to land.

LGTM with a nit.
Also I don't quite understand why being additive is important? Isn't pointer subtraction basically the same?



================
Comment at: lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:78
 
+const Expr *peelOffPointerArithmetic(const BinaryOperator *B) {
+  if (B->isAdditiveOp() && B->getType()->isPointerType()) {
----------------
static.
+1 for using functions.


Repository:
  rC Clang

https://reviews.llvm.org/D45071





More information about the cfe-commits mailing list