[cfe-commits] r168740 - in /cfe/trunk: lib/CodeGen/CGCall.cpp lib/CodeGen/CGExpr.cpp lib/Sema/SemaExpr.cpp lib/Sema/SemaInit.cpp test/CodeGenObjC/arc-blocks.m test/CodeGenObjC/arc-foreach.m test/CodeGenObjC/arc-loadweakretained-release.m test/CodeGenObjC/arc.m test/CodeGenObjCXX/arc.mm

Fariborz Jahanian fjahanian at apple.com
Tue Nov 27 15:13:05 PST 2012


On Nov 27, 2012, at 3:02 PM, Fariborz Jahanian wrote:

> Author: fjahanian
> Date: Tue Nov 27 17:02:53 2012
> New Revision: 168740
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=168740&view=rev
> Log:
> objective-C arc: load of a __weak object happens via call to
> objc_loadWeak. This retains and autorelease the weakly-refereced
> object. This hidden autorelease sometimes makes __weak variable alive even
> after the weak reference is erased, because the object is still referenced
> by an autorelease pool. This patch overcomes this behavior by loading a 
> weak object via call to objc_loadWeakRetained(), followng it by objc_release
> at appropriate place, thereby removing the hidden autorelease. // rdar://10849570
> 

Failed to mention that patch was reviewed offline by John McCall.
- Fariborz





More information about the cfe-commits mailing list