[cfe-commits] r70614 - /cfe/trunk/test/Analysis/null-deref-ps.c

Ted Kremenek kremenek at apple.com
Fri May 1 17:41:03 PDT 2009


Author: kremenek
Date: Fri May  1 19:41:02 2009
New Revision: 70614

URL: http://llvm.org/viewvc/llvm-project?rev=70614&view=rev
Log:
Add another null pointer check test case.

Modified:
    cfe/trunk/test/Analysis/null-deref-ps.c

Modified: cfe/trunk/test/Analysis/null-deref-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/null-deref-ps.c?rev=70614&r1=70613&r2=70614&view=diff

==============================================================================
--- cfe/trunk/test/Analysis/null-deref-ps.c (original)
+++ cfe/trunk/test/Analysis/null-deref-ps.c Fri May  1 19:41:02 2009
@@ -117,6 +117,20 @@
   return x;
 }
 
+int* f7b(int *x) {
+  
+  int* p = 0;
+  
+  if (((void*)0) == x)
+    p = qux();
+  
+  if (((void*)0) == x)
+    *p = 1; // no-warning
+    
+  return x;
+}
+
+
 int f8(int *p, int *q) {
   if (!p)
     if (p)





More information about the cfe-commits mailing list