[cfe-commits] r50072 - /cfe/trunk/test/Analysis/null-deref-ps.c
Ted Kremenek
kremenek at apple.com
Mon Apr 21 16:44:17 PDT 2008
Author: kremenek
Date: Mon Apr 21 18:44:17 2008
New Revision: 50072
URL: http://llvm.org/viewvc/llvm-project?rev=50072&view=rev
Log:
Added null dereference test case looking for null dereferences involving MemberExpr.
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=50072&r1=50071&r2=50072&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/null-deref-ps.c (original)
+++ cfe/trunk/test/Analysis/null-deref-ps.c Mon Apr 21 18:44:17 2008
@@ -4,3 +4,15 @@
if (p) *p = 1;
else *p = 0; // expected-warning{{ereference}}
}
+
+struct foo_struct {
+ int x;
+};
+
+int f2(struct foo_struct* p) {
+
+ if (p)
+ p->x = 1;
+
+ return p->x++;
+}
More information about the cfe-commits
mailing list