[cfe-commits] r92103 - /cfe/trunk/test/Analysis/misc-ps-region-store.m
Ted Kremenek
kremenek at apple.com
Wed Dec 23 16:48:11 PST 2009
Author: kremenek
Date: Wed Dec 23 18:48:11 2009
New Revision: 92103
URL: http://llvm.org/viewvc/llvm-project?rev=92103&view=rev
Log:
Add test case for PR 4358.
Modified:
cfe/trunk/test/Analysis/misc-ps-region-store.m
Modified: cfe/trunk/test/Analysis/misc-ps-region-store.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps-region-store.m?rev=92103&r1=92102&r2=92103&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps-region-store.m (original)
+++ cfe/trunk/test/Analysis/misc-ps-region-store.m Wed Dec 23 18:48:11 2009
@@ -662,3 +662,25 @@
return 1;
}
+//===----------------------------------------------------------------------===//
+// PR 4358 - Without field-sensitivity, this code previously triggered
+// a false positive that 'uninit' could be uninitialized at the call
+// to pr4358_aux().
+//===----------------------------------------------------------------------===//
+
+struct pr4358 {
+ int bar;
+ int baz;
+};
+void pr4358_aux(int x);
+void pr4358(struct pr4358 *pnt) {
+ int uninit;
+ if (pnt->bar < 3) {
+ uninit = 1;
+ } else if (pnt->baz > 2) {
+ uninit = 3;
+ } else if (pnt->baz <= 2) {
+ uninit = 2;
+ }
+ pr4358_aux(uninit); // no-warning
+}
More information about the cfe-commits
mailing list