[cfe-commits] r41008 - in /cfe/trunk/Sema: Sema.h SemaChecking.cpp

Ted Kremenek kremenek at apple.com
Fri Aug 10 14:21:05 PDT 2007


Author: kremenek
Date: Fri Aug 10 16:21:05 2007
New Revision: 41008

URL: http://llvm.org/viewvc/llvm-project?rev=41008&view=rev
Log:
Added "id_idx" parameter to CheckPrintfArguments.  This will be used
by CheckPrintfArguments to determine if a given printf function
accepts a va_arg argument.


Modified:
    cfe/trunk/Sema/Sema.h
    cfe/trunk/Sema/SemaChecking.cpp

Modified: cfe/trunk/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/Sema.h?rev=41008&r1=41007&r2=41008&view=diff

==============================================================================
--- cfe/trunk/Sema/Sema.h (original)
+++ cfe/trunk/Sema/Sema.h Fri Aug 10 16:21:05 2007
@@ -426,8 +426,9 @@
   void CheckFunctionCall(Expr *Fn, FunctionDecl *FDecl,
                          Expr** Args, unsigned NumArgsInCall);
 
-  void CheckPrintfArguments(Expr *Fn, FunctionDecl *FDecl, unsigned format_idx,
-                            Expr** Args, unsigned NumArgsInCall);
+  void CheckPrintfArguments(Expr *Fn, unsigned id_idx, FunctionDecl *FDecl,
+                            unsigned format_idx, Expr** Args,
+                            unsigned NumArgsInCall);
 };
 
 

Modified: cfe/trunk/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaChecking.cpp?rev=41008&r1=41007&r2=41008&view=diff

==============================================================================
--- cfe/trunk/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/Sema/SemaChecking.cpp Fri Aug 10 16:21:05 2007
@@ -57,7 +57,7 @@
       case id_vsprintf:  format_idx = 1; break;
       case id_vprintf:   format_idx = 1; break;
     }    
-    CheckPrintfArguments(Fn, FDecl, format_idx, Args, NumArgsInCall);
+    CheckPrintfArguments(Fn, i, FDecl, format_idx, Args, NumArgsInCall);
   }
 }
 
@@ -70,8 +70,9 @@
 ///  FormatGuard: Automatic Protection From printf Format String
 ///  Vulnerabilities, Proceedings of the 10th USENIX Security Symposium, 2001.
 void
-Sema::CheckPrintfArguments(Expr *Fn, FunctionDecl *FDecl, unsigned format_idx,
-                           Expr** Args, unsigned NumArgsInCall) {
+Sema::CheckPrintfArguments(Expr *Fn, unsigned id_idx, FunctionDecl *FDecl,
+                           unsigned format_idx, Expr** Args, 
+                           unsigned NumArgsInCall) {
                            
   assert( format_idx < NumArgsInCall );
 





More information about the cfe-commits mailing list