summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-06-08 18:44:43 +0000
committerAnna Zaks <ganna@apple.com>2012-06-08 18:44:43 +0000
commit528b14c5d9bc5b55fedba858b67487dacd23820c (patch)
tree1ab5e7c71055aa70eb5fa38432b2fa2276e17ac3 /clang/lib/StaticAnalyzer/Checkers
parentbf86b295bb12f27331ce524eeb06f95a66c86514 (diff)
downloadbcm5719-llvm-528b14c5d9bc5b55fedba858b67487dacd23820c.tar.gz
bcm5719-llvm-528b14c5d9bc5b55fedba858b67487dacd23820c.zip
[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)); llvm-svn: 158219
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp
index 46b3500fb08..6292a472512 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp
+++ b/clang/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());
}
OpenPOWER on IntegriCloud