[llvm-commits] [poolalloc] r144234 - in /poolalloc/trunk: include/dsa/CStdLib.h lib/DSA/StdLibPass.cpp

John Criswell criswell at uiuc.edu
Wed Nov 9 14:42:49 PST 2011


Author: criswell
Date: Wed Nov  9 16:42:49 2011
New Revision: 144234

URL: http://llvm.org/viewvc/llvm-project?rev=144234&view=rev
Log:
Have the DSA StdLib pass recognize the invalid free checking functions and
pool_fgets().

Modified:
    poolalloc/trunk/include/dsa/CStdLib.h
    poolalloc/trunk/lib/DSA/StdLibPass.cpp

Modified: poolalloc/trunk/include/dsa/CStdLib.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/CStdLib.h?rev=144234&r1=144233&r2=144234&view=diff
==============================================================================
--- poolalloc/trunk/include/dsa/CStdLib.h (original)
+++ poolalloc/trunk/include/dsa/CStdLib.h Wed Nov  9 16:42:49 2011
@@ -45,6 +45,7 @@
     { "pool_index",       1 },
     { "pool_rindex",      1 },
     { "pool_strcasestr",  2 },
+    { "pool_fgets",       1 },
     {  0,                 0 }
   };
 

Modified: poolalloc/trunk/lib/DSA/StdLibPass.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/StdLibPass.cpp?rev=144234&r1=144233&r2=144234&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/StdLibPass.cpp (original)
+++ poolalloc/trunk/lib/DSA/StdLibPass.cpp Wed Nov  9 16:42:49 2011
@@ -83,6 +83,7 @@
 #define NRET_YNARGS   {0,1,0,0,0,0,0,0,0,0}
 #define YRET_YNARGS   {1,1,0,0,0,0,0,0,0,0}
 #define YRET_NNYARGS  {1,0,0,1,1,1,1,1,1,1}
+#define YRET_YNYARGS  {1,1,0,1,1,1,1,1,1,1}
 #define NRET_NNYARGS  {0,0,0,1,1,1,1,1,1,1}
 #define YRET_NNYNARGS {1,0,0,1,0,0,0,0,0,0}
 #define NRET_NNNYARGS {0,0,0,0,1,1,1,1,1,1}
@@ -260,6 +261,8 @@
   {"fastlscheck",      {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
   {"poolcheckalign",   {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
   {"poolcheckalignui", {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
+  {"poolcheck_free",   {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
+  {"poolcheck_freeui", {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
   {"funccheck",        {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
   {"funccheckui",      {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
 
@@ -268,6 +271,8 @@
   {"fastlscheck_debug",      {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
   {"poolcheckalign_debug",   {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
   {"poolcheckalignui_debug", {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
+  {"poolcheck_free_debug",   {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
+  {"poolcheck_freeui_debug", {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
   {"funccheck_debug",  {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
   {"funccheckui_debug",{NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
 
@@ -338,6 +343,9 @@
   {"pool___fprintf_chk",  {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
   {"pool___sprintf_chk",  {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
   {"pool___snprintf_chk", {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
+
+  // Important C I/O functions
+  {"pool_fgets",      {NRET_NNYARGS, YRET_YNYARGS,  NRET_NARGS, NRET_NARGS,  true}},
   
   // Type Checks
   {"trackArgvType",        {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS,   false}},





More information about the llvm-commits mailing list