Re: [PATCH] D23112: [analyzer] Correctly add assumptions based on array bounds.

2016-08-22 Thread Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL279425: [analyzer] Correctly add assumptions based on array bounds. (authored by xazax). Changed prior to commit: https://reviews.llvm.org/D23112?vs=68023&id=68840#toc Repository: rL LLVM https://re

Re: [PATCH] D23112: [analyzer] Correctly add assumptions based on array bounds.

2016-08-18 Thread Artem Dergachev via cfe-commits
NoQ added a comment. On second thought, in `RangeConstraintManager` we need a different functionality. In particular, from `4 * x < 1000` it does not follow that `x < 250` in the general case (due to possible overflows). But in the case of this checker, it doesn't matter - we are always sure th

Re: [PATCH] D23112: [analyzer] Correctly add assumptions based on array bounds.

2016-08-15 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. I added a (proof of concept?) implementation to simplify the constraints in the checker. I wonder what do you think. https://reviews.llvm.org/D23112 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llv

Re: [PATCH] D23112: [analyzer] Correctly add assumptions based on array bounds.

2016-08-15 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 68023. xazax.hun added a comment. - Simplifiy generated constraints. https://reviews.llvm.org/D23112 Files: lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp test/Analysis/out-of-bounds.c Index: test/Analysis/out-of-bounds.c ===

Re: [PATCH] D23112: [analyzer] Correctly add assumptions based on array bounds.

2016-08-10 Thread Artem Dergachev via cfe-commits
NoQ added a comment. Whoops, forgot to answer: In https://reviews.llvm.org/D23112#508333, @xazax.hun wrote: > I am not sure that the checker is the appropriate way to fix the remaining > issue with this checker. Yeah, there are anyway more problems that require this functionality in the `Ran

Re: [PATCH] D23112: [analyzer] Correctly add assumptions based on array bounds.

2016-08-08 Thread Artem Dergachev via cfe-commits
NoQ accepted this revision. This revision is now accepted and ready to land. Comment at: test/Analysis/out-of-bounds.c:153 @@ +152,3 @@ +// The result is unknown for the same reason as above. +void test_asume_after_access(unsigned long x) { + int buf[100]; Yay, t

Re: [PATCH] D23112: [analyzer] Correctly add assumptions based on array bounds.

2016-08-08 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. I am not sure that the checker is the appropriate way to fix the remaining issue with this checker. I think generating simpler constraints without loosing any generality is non trivial. https://reviews.llvm.org/D23112 __

Re: [PATCH] D23112: [analyzer] Correctly add assumptions based on array bounds.

2016-08-08 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 67135. xazax.hun added a comment. - Address review comments. https://reviews.llvm.org/D23112 Files: lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp test/Analysis/out-of-bounds.c Index: test/Analysis/out-of-bounds.c ===

Re: [PATCH] D23112: [analyzer] Correctly add assumptions based on array bounds.

2016-08-03 Thread Artem Dergachev via cfe-commits
NoQ added a comment. Nice catch! Now, this needs a test. How about this one: // enable the debug.ExprInspection checker? void clang_analyzer_eval(int); void test_asume_after_access(unsigned long x) { char buf[100]; buf[x] = 1; clang_analyzer_eval(x <= 99); // expected-warnin

[PATCH] D23112: [analyzer] Correctly add assumptions based on array bounds.

2016-08-03 Thread Gábor Horváth via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: zaks.anna, dcoughlin, NoQ. xazax.hun added a subscriber: cfe-commits. Right now due to a missing brace error the assumptions that an index is inbound in case we are under constrained is not added. https://reviews.llvm.org/D23112 Files: