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

Jordy Rose jediknil at belkadan.com
Fri Jul 15 14:28:16 PDT 2011


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.)

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