[PATCH] D37478: [analyzer] Implement pointer arithmetic on constants

2017-10-10 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL315296: [analyzer] Implement pointer arithmetic on constants (authored by xazax). Changed prior to commit: https://reviews.llvm.org/D37478?vs=118182&id=118342#toc Repository: rL LLVM https://reviews

[PATCH] D37478: [analyzer] Implement pointer arithmetic on constants

2017-10-09 Thread Rafael Stahl via Phabricator via cfe-commits
r.stahl added a comment. Since I do not have commit access, it would be nice if someone committed this for me. Thanks! https://reviews.llvm.org/D37478 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/lis

[PATCH] D37478: [analyzer] Implement pointer arithmetic on constants

2017-10-09 Thread Devin Coughlin via Phabricator via cfe-commits
dcoughlin accepted this revision. dcoughlin added a comment. This revision is now accepted and ready to land. This looks good to me! Thanks for adding this. Do you have commit access, or do you need someone to commit it for you? https://reviews.llvm.org/D37478 ___

[PATCH] D37478: [analyzer] Implement pointer arithmetic on constants

2017-10-09 Thread Rafael Stahl via Phabricator via cfe-commits
r.stahl updated this revision to Diff 118182. r.stahl marked an inline comment as done. r.stahl edited the summary of this revision. r.stahl added a comment. Herald added a subscriber: szepet. addressed review comments. updated summary. https://reviews.llvm.org/D37478 Files: lib/StaticAnalyze

[PATCH] D37478: [analyzer] Implement pointer arithmetic on constants

2017-09-29 Thread Devin Coughlin via Phabricator via cfe-commits
dcoughlin requested changes to this revision. dcoughlin added a subscriber: zaks.anna. dcoughlin added a comment. This revision now requires changes to proceed. Rafael: Thanks for the patch! @NoQ, @zaks.anna, and I spoke about this off-line yesterday. While this patch improves the modeling of po

[PATCH] D37478: [analyzer] Implement pointer arithmetic on constants

2017-09-07 Thread Rafael Stahl via Phabricator via cfe-commits
r.stahl updated this revision to Diff 114126. r.stahl added a comment. addressed the review comments https://reviews.llvm.org/D37478 Files: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp test/Analysis/explain-svals.cpp test/Analysis/inlining/inline-defensive-checks.c test/Analysis/pointe

[PATCH] D37478: [analyzer] Implement pointer arithmetic on constants

2017-09-06 Thread Rafael Stahl via Phabricator via cfe-commits
r.stahl added a comment. To be honest I was quite surprised that this change in behavior didn't cause more test failures, because for detecting null dereferences the old behavior is definitely more useful. Since it did not, I was convinced that this change is desired. We use the analyzer for f

[PATCH] D37478: [analyzer] Implement pointer arithmetic on constants

2017-09-06 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. I've seen this recently, and while i agree that the fix is correct, i'm not entirely sure that the test cases are correct. As weird as this may sound, null dereference is not an attempt to read from or write to memory address 0. Instead, it is about using a null pointer as

[PATCH] D37478: [analyzer] Implement pointer arithmetic on constants

2017-09-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. This revision is now accepted and ready to land. One nit, otherwise LGTM! Thanks for fixing this! Comment at: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:938 llvm::APSInt Multiplicand(rightI.getBitWidth(), /*

[PATCH] D37478: [analyzer] Implement pointer arithmetic on constants

2017-09-05 Thread Rafael Stahl via Phabricator via cfe-commits
r.stahl created this revision. Herald added a subscriber: eraman. The "Multiplicand" variable in SimpleSValBuilder::evalBinOpLN was always initialized to zero, causing all pointer arithmetic on constant values to be no-ops. This fixes two FIXMEs in existing tests. The added tests were all faili