Object created inside scope dealloced even when used outside scope

Originator:mattias.wadman
Number:rdar://12796918 Date Originated:03-Dec-2012 05:52 PM
Status:Closed Resolved:
Product:iPhone SDK Product Version:Xcode 4.5.2
Classification:Other bug Reproducible:Always
 
03-Dec-2012 05:52 PM Mattias Wadman:
Summary:
I've tracked down a use after dealloc crash when using ARC and the release build configuration (debug seems to work fine). The problem happens when creating an object inside a if-scope with a non-constant condition, assigning it to a variable from outside the scope, and then only reference the variable using Objective-C array or dictionary literals.

See my stackoverflow question for reproduction case and more details:

http://stackoverflow.com/questions/13687509/object-created-inside-scope-dealloced-even-when-used-outside-scope

Steps to Reproduce:
See stackoverflow link.

Actual Results:
object is dealloced

Regression:

Notes:

Comments

Fixed in iOS 6.1 DP3

By mattias.wadman at Dec. 7, 2012, 9:41 a.m. (reply...)

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!