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:
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
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:
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
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
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
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
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
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
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
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
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] ==
12 matches
Mail list logo