git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120796 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek 2010-12-03 06:53:12 +00:00
Родитель 40406fe63d
Коммит 83300e884d
1 изменённых файлов: 24 добавлений и 0 удалений

Просмотреть файл

@ -1386,3 +1386,27 @@ void r8272168() {
}
@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);
}
}