[cfe-commits] r90466 - /cfe/trunk/test/Analysis/misc-ps-region-store.m
Ted Kremenek
kremenek at apple.com
Thu Dec 3 10:29:20 PST 2009
Author: kremenek
Date: Thu Dec 3 12:29:20 2009
New Revision: 90466
URL: http://llvm.org/viewvc/llvm-project?rev=90466&view=rev
Log:
Add another blocks test case illustrating how parameters passed-by-reference in block invocations are invalidated (just like function calls).
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=90466&r1=90465&r2=90466&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps-region-store.m (original)
+++ cfe/trunk/test/Analysis/misc-ps-region-store.m Thu Dec 3 12:29:20 2009
@@ -568,3 +568,18 @@
return z;
}
+int blocks_2(int *p, int z) {
+ int *q = 0;
+ void (^bar)(int **) = ^(int **r){ *r = p; };
+
+ if (z) {
+ // The call to 'bar' might cause 'q' to be invalidated.
+ bar(&q);
+ *q = 0x1; // no-warning
+ }
+ else {
+ *q = 0xDEADBEEF; // expected-warning{{Dereference of null pointer}}
+ }
+ return z;
+}
+
More information about the cfe-commits
mailing list