[cfe-commits] r135301 - in /cfe/trunk: lib/ARCMigrate/TransRetainReleaseDealloc.cpp test/ARCMT/releases.m test/ARCMT/releases.m.result

Argyrios Kyrtzidis kyrtzidis at apple.com
Fri Jul 15 15:06:05 PDT 2011


On Jul 15, 2011, at 2:28 PM, Jordy Rose wrote:

> This seems like another of those cases where we should prefer 'nil' and then 'NULL' to straight 0. I know it's a coding style thing, but 'nil' seems to be Apple's style, for variables with object type anyway. (Not sure what's best for blocks and CFTypeRefs.)

Fair point; in r135309.

> 
> Jordy
> 
> 
> On Jul 15, 2011, at 14:11, Argyrios Kyrtzidis wrote:
> 
>> Author: akirtzidis
>> Date: Fri Jul 15 16:11:23 2011
>> New Revision: 135301
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=135301&view=rev
>> Log:
>> [arcmt] For:
>> 
>> id x = ...
>> @try {
>> ...
>> } @finally {
>> [x release];
>> }
>> 
>> Migrator will drop the release. It's better to change it to "x = 0" in a @finally to avoid leak when exception is thrown.
>> 
>> rdar://9398256
>> 
>> Modified:
>>   cfe/trunk/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
>>   cfe/trunk/test/ARCMT/releases.m
>>   cfe/trunk/test/ARCMT/releases.m.result
> 




More information about the cfe-commits mailing list