[cfe-commits] r159462 - /cfe/trunk/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp

Ted Kremenek kremenek at apple.com
Fri Jun 29 14:01:35 PDT 2012


Author: kremenek
Date: Fri Jun 29 16:01:35 2012
New Revision: 159462

URL: http://llvm.org/viewvc/llvm-project?rev=159462&view=rev
Log:
Revert "Tweak insecureAPI analyzer checks to have the ability to be individually disabled."

Jordan Rose corrected me that this actually isn't needed.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp?rev=159462&r1=159461&r2=159462&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp Fri Jun 29 16:01:35 2012
@@ -379,6 +379,13 @@
 //===----------------------------------------------------------------------===//
 
 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 @@
 }
 
 #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)





More information about the cfe-commits mailing list