diff options
| author | Ted Kremenek <kremenek@apple.com> | 2009-05-02 00:41:02 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2009-05-02 00:41:02 +0000 |
| commit | 2bfed98b0af08824847f6bf1d48a01d4a081aaba (patch) | |
| tree | ec46a360fcb722c75e2ef3a9d9361990c248ebf1 | |
| parent | d2c2d172dab8de8ed99bd5f41d78013feb117ca0 (diff) | |
| download | bcm5719-llvm-2bfed98b0af08824847f6bf1d48a01d4a081aaba.tar.gz bcm5719-llvm-2bfed98b0af08824847f6bf1d48a01d4a081aaba.zip | |
Add another null pointer check test case.
llvm-svn: 70614
| -rw-r--r-- | clang/test/Analysis/null-deref-ps.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/Analysis/null-deref-ps.c b/clang/test/Analysis/null-deref-ps.c index 2b0ed0aadbc..e78aea0f8cb 100644 --- a/clang/test/Analysis/null-deref-ps.c +++ b/clang/test/Analysis/null-deref-ps.c @@ -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) |

