]> granicus.if.org Git - clang/commitdiff
Add another null pointer check test case.
authorTed Kremenek <kremenek@apple.com>
Sat, 2 May 2009 00:41:02 +0000 (00:41 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 2 May 2009 00:41:02 +0000 (00:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70614 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/null-deref-ps.c

index 2b0ed0aadbcf7bf2082b95dccdf1805a9041e30e..e78aea0f8cb3f4a13bcbc84dae29c018152fd9b3 100644 (file)
@@ -117,6 +117,20 @@ int f7(int x) {
   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)