diff options
author | Anna Zaks <ganna@apple.com> | 2012-06-08 18:44:43 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-06-08 18:44:43 +0000 |
commit | 2e336ac5ace420470bbb0ff54a94a5484443a44f (patch) | |
tree | 9d2c96652685dde14cad60133aef390a4a0112b7 /lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp | |
parent | 6fe6a49c4058211ff4489023c78615ec0266c5ff (diff) |
[analyzer] MallocSizeofChecker false positive: when sizeof is argument
to addition.
We should not to warn in case the malloc size argument is an
addition containing 'sizeof' operator - it is common to use the pattern
to pack values of different sizes into a buffer.
Ex:
uint8_t *buffer = (uint8_t*)malloc(dataSize + sizeof(length));
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158219 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp b/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp index 46b3500fb0..6292a47251 100644 --- a/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp @@ -118,11 +118,6 @@ public: Visit(E->getRHS()); } - void VisitBinAdd(const BinaryOperator *E) { - Visit(E->getLHS()); - Visit(E->getRHS()); - } - void VisitImplicitCastExpr(const ImplicitCastExpr *E) { return Visit(E->getSubExpr()); } |