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

Ted Kremenek kremenek at apple.com
Mon May 4 10:27:34 PDT 2009


Author: kremenek
Date: Mon May  4 12:27:32 2009
New Revision: 70883

URL: http://llvm.org/viewvc/llvm-project?rev=70883&view=rev
Log:
Update 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=70883&r1=70882&r2=70883&view=diff

==============================================================================
--- cfe/trunk/test/Analysis/null-deref-ps.c (original)
+++ cfe/trunk/test/Analysis/null-deref-ps.c Mon May  4 12:27:32 2009
@@ -130,6 +130,35 @@
   return x;
 }
 
+int* f7c(int *x) {
+  
+  int* p = 0;
+  
+  if (((void*)0) == x)
+    p = qux();
+  
+  if (((void*)0) != x)
+    return x;
+    
+  // THIS IS WRONG.  THIS NEEDS TO BE FIXED.
+  *p = 1; // expected-warning{{null}}
+  return x;
+}
+
+int* f7c2(int *x) {
+  
+  int* p = 0;
+  
+  if (((void*)0) == x)
+    p = qux();
+  
+  if (((void*)0) == x)
+    return x;
+    
+  *p = 1; // expected-warning{{null}}
+  return x;
+}
+
 
 int f8(int *p, int *q) {
   if (!p)





More information about the cfe-commits mailing list