hiraditya updated this revision to Diff 35461.
hiraditya added a comment.
Updated commit message and summary.
http://reviews.llvm.org/D9924
Files:
lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp
test/Analysis/malloc-overflow.c
test/Analysis/malloc-overflow2.c
Index: test/An
dcoughlin added a comment.
Aditya, can you update the patch title and summary to a commit message so I can
commit it? Thanks!
http://reviews.llvm.org/D9924
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailma
hiraditya added a comment.
Hi Anna,
I have updated the patch to address the changes you asked for.
http://reviews.llvm.org/D9924
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hiraditya updated this revision to Diff 34525.
hiraditya added a comment.
Emit warning when numerator is unknown (may overflow).
The checker will ignore warning when numerator and denominator are both
known.
Added test case.
Format patch with clang-format.
http://reviews.llvm.org/D9924
Files:
zaks.anna added a comment.
> > If a' might overflow, then in this case we can emit warning stating that
> > the overflow is caused because a' might overflow.
>
>
> I see your point now! I think we should improve the diagnostic that is
> produced in this case!
How was the following comment
hiraditya updated this revision to Diff 34323.
hiraditya added a comment.
Rebase with latest changes.
http://reviews.llvm.org/D9924
Files:
lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp
test/Analysis/malloc-overflow.c
test/Analysis/malloc-overflow2.c
Index: test/Analysis/m
hiraditya added a comment.
Please review my patch. Thanks.
http://reviews.llvm.org/D9924
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hiraditya updated this revision to Diff 32381.
hiraditya added a comment.
Refactored the code and check whether denominator > 0.
http://reviews.llvm.org/D9924
Files:
lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp
test/Analysis/malloc-overflow.c
test/Analysis/malloc-overflow
l.com
> CC: cfe-commits@lists.llvm.org
> Subject: Re: [PATCH] D9924: Ignore report when the argument to malloc is
> assigned known value
>
> zaks.anna added a comment.
>
>> Maybe, I should add a check that `a, b, n' are positive.
>
>> So, in this case sta
zaks.anna added a comment.
> Maybe, I should add a check that `a, b, n' are positive.
> So, in this case static analyzer can choose to be strict and reject false
> positives.
What would this buy us? Does the checker warn on underflow?
> If a' might overflow, then in this case we can emit war
l.com
> CC: cfe-commits@lists.llvm.org
> Subject: Re: [PATCH] D9924: Ignore report when the argument to malloc is
> assigned known value
>
> zaks.anna added a comment.
>
>> x = a/b; where n < b
>
>> malloc (x*n); Then x*n will not overflow
>
>
> I am not
zaks.anna added a comment.
> x = a/b; where n < b
> malloc (x*n); Then x*n will not overflow
I am not convinced that the new rule is strong enough. 'a' can be any
expression. For example, maybe you have (b-1)*a/b and the denominator cancels
out something unrelated to 'n' in the numerator? Ma
hiraditya updated this revision to Diff 31913.
hiraditya added a comment.
Added free, to avoid an unrelated warning.
http://reviews.llvm.org/D9924
Files:
lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp
test/Analysis/malloc-overflow.c
test/Analysis/malloc-overflow2.c
Index:
hiraditya updated this revision to Diff 31904.
hiraditya added a comment.
Added comments and changed the variable name.
http://reviews.llvm.org/D9924
Files:
lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp
test/Analysis/malloc-overflow.c
test/Analysis/malloc-overflow2.c
Inde
hiraditya added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp:182
@@ +181,3 @@
+ if (rhs->isEvaluatable(Context))
+eraseAssign = true;
+ // Erase if the multiplicand was assigned a value,
zaks.anna wro
zaks.anna added a comment.
Thanks! See the comments inline.
Comment at: lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp:182
@@ +181,3 @@
+ if (rhs->isEvaluatable(Context))
+eraseAssign = true;
+ // Erase if the multiplicand was assigned a value,
-
16 matches
Mail list logo