]> granicus.if.org Git - clang/commitdiff
Revert "Tweak insecureAPI analyzer checks to have the ability to be individually...
authorTed Kremenek <kremenek@apple.com>
Fri, 29 Jun 2012 21:01:35 +0000 (21:01 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 29 Jun 2012 21:01:35 +0000 (21:01 +0000)
Jordan Rose corrected me that this actually isn't needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159462 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp

index 053b83f894dc542d97e6ab4ef056eda98feca74a..dde90713ce18241da3c16cfce25eec70ae8fdb34 100644 (file)
@@ -379,6 +379,13 @@ 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)
@@ -762,9 +769,8 @@ public:
 }
 
 #define REGISTER_CHECKER(name) \
-namespace { class Checker_##name : public SecuritySyntaxChecker {}; }\
 void ento::register##name(CheckerManager &mgr) {\
-  mgr.registerChecker<Checker_##name>()->filter.check_##name = true;\
+  mgr.registerChecker<SecuritySyntaxChecker>()->filter.check_##name = true;\
 }
 
 REGISTER_CHECKER(gets)