]> granicus.if.org Git - clang/commitdiff
Update test case.
authorTed Kremenek <kremenek@apple.com>
Mon, 4 May 2009 17:27:32 +0000 (17:27 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 4 May 2009 17:27:32 +0000 (17:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70883 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/null-deref-ps.c

index e78aea0f8cb3f4a13bcbc84dae29c018152fd9b3..7f1db8749c13f8ba003d6b034996ead7da555b73 100644 (file)
@@ -130,6 +130,35 @@ int* f7b(int *x) {
   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)