diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-06-29 20:44:58 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-06-29 20:44:58 +0000 |
commit | a33b078e7382b42c79a1c814bf709e8215f10cf0 (patch) | |
tree | f9d8bf14d5e3cbc2c3949c33e7fad87f8b0ab145 /clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp | |
parent | cf86744ffeb267c85fe485c26ecc1c906af1b6a7 (diff) | |
download | bcm5719-llvm-a33b078e7382b42c79a1c814bf709e8215f10cf0.tar.gz bcm5719-llvm-a33b078e7382b42c79a1c814bf709e8215f10cf0.zip |
Tweak insecureAPI analyzer checks to have the ability to be individually disabled.
The solution is a bit inefficient: it creates N checkers, one for each check, and
each check does a dispatch on the function name. This is redundant, but we can fix
this once we have the proper ability to enable/disable subchecks.
Fixes <rdar://problem/11780180>.
llvm-svn: 159459
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp b/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp index dde90713ce1..053b83f894d 100644 --- a/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp @@ -379,13 +379,6 @@ void WalkAST::checkCall_getpw(const CallExpr *CE, const FunctionDecl *FD) { //===----------------------------------------------------------------------===// void WalkAST::checkCall_mktemp(const CallExpr *CE, const FunctionDecl *FD) { - if (!filter.check_mktemp) { - // Fall back to the security check of looking for enough 'X's in the - // format string, since that is a less severe warning. - checkCall_mkstemp(CE, FD); - return; - } - const FunctionProtoType *FPT = dyn_cast<FunctionProtoType>(FD->getType().IgnoreParens()); if(!FPT) @@ -769,8 +762,9 @@ public: } #define REGISTER_CHECKER(name) \ +namespace { class Checker_##name : public SecuritySyntaxChecker {}; }\ void ento::register##name(CheckerManager &mgr) {\ - mgr.registerChecker<SecuritySyntaxChecker>()->filter.check_##name = true;\ + mgr.registerChecker<Checker_##name>()->filter.check_##name = true;\ } REGISTER_CHECKER(gets) |