[PATCH] D28278: [StaticAnalyzer] dont show wrong 'garbage value' warning when there is array index out of bounds

2017-02-27 Thread Daniel Marjamäki via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL296326: [analyzer] clarify 'result is garbage value' when it is out of bounds (authored by danielmarjamaki). Changed prior to commit: https://reviews.llvm.org/D28278?vs=89641=89854#toc Repository:

[PATCH] D28278: [StaticAnalyzer] dont show wrong 'garbage value' warning when there is array index out of bounds

2017-02-24 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna accepted this revision. zaks.anna added a comment. This revision is now accepted and ready to land. Thank you! Repository: rL LLVM https://reviews.llvm.org/D28278 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D28278: [StaticAnalyzer] dont show wrong 'garbage value' warning when there is array index out of bounds

2017-02-24 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki updated this revision to Diff 89641. danielmarjamaki added a comment. Fixed review comment. Broke out function. Repository: rL LLVM https://reviews.llvm.org/D28278 Files: lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp test/Analysis/uninit-vals-ps.c Index:

[PATCH] D28278: [StaticAnalyzer] dont show wrong 'garbage value' warning when there is array index out of bounds

2017-02-23 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added inline comments. Comment at: lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp:76 if (Ex) { + bool ArrayIndexOutOfBounds = false; + if (isa(Ex)) { Please, pull this out into a sub-rutine. Thanks! https://reviews.llvm.org/D28278

[PATCH] D28278: [StaticAnalyzer] dont show wrong 'garbage value' warning when there is array index out of bounds

2017-02-23 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki updated this revision to Diff 89540. danielmarjamaki added a comment. Making the error message more precise. https://reviews.llvm.org/D28278 Files: lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp test/Analysis/uninit-vals-ps.c Index: test/Analysis/uninit-vals-ps.c

[PATCH] D28278: [StaticAnalyzer] dont show wrong 'garbage value' warning when there is array index out of bounds

2017-02-23 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki added a comment. In https://reviews.llvm.org/D28278#677905, @zaks.anna wrote: > Does the code you added detects array out of bounds cases without false > positives? Is it an option to just have this checkers produce a more precise > error message in the specific case. > > A lot

[PATCH] D28278: [StaticAnalyzer] dont show wrong 'garbage value' warning when there is array index out of bounds

2017-02-15 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added a comment. Does the code you added detects array out of bounds cases without false positives? Is it an option to just have this checkers produce a more precise error message in the specific case. A lot of work will probably need to be done to implement a proper array out of

[PATCH] D28278: [StaticAnalyzer] dont show wrong 'garbage value' warning when there is array index out of bounds

2017-02-15 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki added a comment. I am not against that the error is shown as long as it's not misleading/wrong. To avoid misleading, in my humble opinion the error message should say "array index out of bounds". Repository: rL LLVM https://reviews.llvm.org/D28278

[PATCH] D28278: [StaticAnalyzer] dont show wrong 'garbage value' warning when there is array index out of bounds

2017-01-12 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added a comment. I think it's more valuable to report a warning here even if the error message is not very precise. Marking something as in bounds when we know it's not does not feel right and could lead to inconsistent states down the road. Repository: rL LLVM

[PATCH] D28278: [StaticAnalyzer] dont show wrong 'garbage value' warning when there is array index out of bounds

2017-01-10 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki added a comment. In https://reviews.llvm.org/D28278#639710, @xazax.hun wrote: > Did you experience any problems with the array out of bounds check lately? In > case it was stable on large code-bases and did not give too many false > positives, I think it might be worth to move

[PATCH] D28278: [StaticAnalyzer] dont show wrong 'garbage value' warning when there is array index out of bounds

2017-01-09 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Did you experience any problems with the array out of bounds check lately? In case it was stable on large code-bases and did not give too many false positives, I think it might be worth to move that check out of alpha at the same time, so users who do not turn on

[PATCH] D28278: [StaticAnalyzer] dont show wrong 'garbage value' warning when there is array index out of bounds

2017-01-03 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki created this revision. danielmarjamaki added reviewers: zaks.anna, dcoughlin. danielmarjamaki added a subscriber: cfe-commits. danielmarjamaki set the repository for this revision to rL LLVM. Example code: void f1(int x) { int a[20] = {0}; if (x==25) {} if (a[x] ==