[llvm-branch-commits] [cfe-branch] r121554 - /cfe/branches/Apple/whitney/test/Analysis/retain-release.m
Daniel Dunbar
daniel at zuster.org
Fri Dec 10 13:37:49 PST 2010
Author: ddunbar
Date: Fri Dec 10 15:37:49 2010
New Revision: 121554
URL: http://llvm.org/viewvc/llvm-project?rev=121554&view=rev
Log:
Merge r120796:
--
Author: Ted Kremenek <kremenek at apple.com>
Date: Fri Dec 3 06:53:12 2010 +0000
Add test case for r120795.
Modified:
cfe/branches/Apple/whitney/test/Analysis/retain-release.m
Modified: cfe/branches/Apple/whitney/test/Analysis/retain-release.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/test/Analysis/retain-release.m?rev=121554&r1=121553&r2=121554&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/test/Analysis/retain-release.m (original)
+++ cfe/branches/Apple/whitney/test/Analysis/retain-release.m Fri Dec 10 15:37:49 2010
@@ -1386,3 +1386,27 @@
}
@end
+// <rdar://problem/8724287> - This test case previously crashed because
+// of a bug in BugReporter.
+extern const void *CFDictionaryGetValue(CFDictionaryRef theDict, const void *key);
+typedef struct __CFError * CFErrorRef;
+extern const CFStringRef kCFErrorUnderlyingErrorKey;
+extern CFDictionaryRef CFErrorCopyUserInfo(CFErrorRef err);
+
+static void rdar_8724287(CFErrorRef error)
+{
+ CFErrorRef error_to_dump;
+
+ error_to_dump = error;
+ while (error_to_dump != ((void*)0)) {
+ CFDictionaryRef info;
+
+ info = CFErrorCopyUserInfo(error_to_dump); // expected-warning{{Potential leak of an object allocated on line 1404 and stored into 'info'}}
+
+ if (info != ((void*)0)) {
+ }
+
+ error_to_dump = (CFErrorRef) CFDictionaryGetValue(info, kCFErrorUnderlyingErrorKey);
+ }
+}
+
More information about the llvm-branch-commits
mailing list