[cfe-commits] r50454 - /cfe/trunk/test/Analysis/null-deref-ps.c
Ted Kremenek
kremenek at apple.com
Tue Apr 29 16:25:10 PDT 2008
Author: kremenek
Date: Tue Apr 29 18:25:09 2008
New Revision: 50454
URL: http://llvm.org/viewvc/llvm-project?rev=50454&view=rev
Log:
Added test case to test null dereference checking with lval::ArrayOffset.
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=50454&r1=50453&r2=50454&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/null-deref-ps.c (original)
+++ cfe/trunk/test/Analysis/null-deref-ps.c Tue Apr 29 18:25:09 2008
@@ -29,6 +29,16 @@
return x[i+1]; // expected-warning{{Dereference of null pointer.}}
}
+int f3_b(char* x) {
+
+ int i = 2;
+
+ if (x)
+ return x[i - 1];
+
+ return x[i+1]++; // expected-warning{{Dereference of null pointer.}}
+}
+
int f4(int *p) {
uintptr_t x = p;
More information about the cfe-commits
mailing list