Static analyser misses leak if variable used in a block

Originator:neilmggall
Number:rdar://12748423 Date Originated:2012-11-26
Status:Open Resolved:No
Product:Developer Tools Product Version:Xcode 4.5.2
Classification:Serious Bug Reproducible:Always
 
Summary: With non-ARC code, Xcode's static analyser misses memory leaks when an object is retained by a simple block.

Steps to Reproduce:
1. Run static analysis on the attached project. Note leak at NGAppDelegate.m:38
2. Uncomment the line inside the block at NGAppDelegate.m:35
3. Run static analysis again and note that this completes successfully. The object is still leaked however.

Expected Results:
Static analysis should be able to detect this simple form of leak. If not, how can ARC work with blocks?

Actual Results:
Static analysis severely crippled as a memory analysis tool in the presence of blocks.

Regression:
Unknown.

Notes:

Example project at http://d.pr/f/UdCf

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!