-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
Description
Bugzilla Link | 3952 |
Resolution | FIXED |
Resolved on | Oct 27, 2016 02:02 |
Version | unspecified |
OS | All |
Attachments | Project demonstrating the problem. |
Reporter | LLVM Bugzilla Contributor |
CC | @tkremenek |
Extended Description
This may or may not be related to http://llvm.org/bugs/show_bug.cgi?id=3888; I'm not clang-savvy enough to know for sure.
Code like the following will falsely warn that 'obj' is leaked:
NSObject *obj = [[NSObject alloc] init];
@​try {
return nil;
} @​catch (NSException *exc) {
[obj release];
obj = nil;
[exc raise];
} @​finally {
[obj release];
}
return nil;
But both the @catch and @finally block clean it up. Really only the @finally is needed, but this example was trimmed from code that needed different cleanup on both paths. The assignment obj=nil avoids @finally hitting a zombie.
Attached a full Xcode project that can be used with scan-build to show the problem.