This revision was automatically updated to reflect the committed changes.
Closed by commit rC328896: [analyzer] Track null or undef values through
pointer arithmetic. (authored by dergachev, committed by ).
Repository:
rC Clang
https://reviews.llvm.org/D45071
Files:
lib/StaticAnalyzer/Core/
NoQ marked an inline comment as done.
NoQ added inline comments.
Comment at: lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:78
+const Expr *peelOffPointerArithmetic(const BinaryOperator *B) {
+ if (B->isAdditiveOp() && B->getType()->isPointerType()) {
george.
NoQ updated this revision to Diff 140466.
NoQ added a comment.
Substraction is an additive operation. Added tests for that. Added even more
tests.
https://reviews.llvm.org/D45071
Files:
lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
test/Analysis/inlining/inline-defensive-checks.c
test/
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/StaticAnaly
NoQ created this revision.
NoQ added reviewers: dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet.
Herald added subscribers: cfe-commits, rnkovacs, eraman.
Pointer arithmetic on null or undefined pointers results in null or undefined
pointers. This is obvious for undefined pointers; for n