diff options
| author | John McCall <rjmccall@apple.com> | 2011-10-01 10:32:24 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2011-10-01 10:32:24 +0000 |
| commit | 248512a573d6333c40d3fc99fe325960e11e060e (patch) | |
| tree | db6684e0d40d6ec5409b52923e2ae77ab344b56c /clang/lib/CodeGen/CGObjCMac.cpp | |
| parent | a55902bf98a4a0b5929ddd80c4ed8fffb2eb2af3 (diff) | |
| download | bcm5719-llvm-248512a573d6333c40d3fc99fe325960e11e060e.tar.gz bcm5719-llvm-248512a573d6333c40d3fc99fe325960e11e060e.zip | |
When performing an @throw in ARC, retain + autorelease
the pointer, being sure to do so before running cleanups
associated with that full-expression. rdar://10042689
llvm-svn: 140945
Diffstat (limited to 'clang/lib/CodeGen/CGObjCMac.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGObjCMac.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index d6eeba292a7..1b317c45f23 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -3204,7 +3204,7 @@ void CGObjCMac::EmitThrowStmt(CodeGen::CodeGenFunction &CGF, llvm::Value *ExceptionAsObject; if (const Expr *ThrowExpr = S.getThrowExpr()) { - llvm::Value *Exception = CGF.EmitScalarExpr(ThrowExpr); + llvm::Value *Exception = CGF.EmitObjCThrowOperand(ThrowExpr); ExceptionAsObject = CGF.Builder.CreateBitCast(Exception, ObjCTypes.ObjectPtrTy); } else { @@ -6002,7 +6002,7 @@ void CGObjCNonFragileABIMac::EmitTryStmt(CodeGen::CodeGenFunction &CGF, void CGObjCNonFragileABIMac::EmitThrowStmt(CodeGen::CodeGenFunction &CGF, const ObjCAtThrowStmt &S) { if (const Expr *ThrowExpr = S.getThrowExpr()) { - llvm::Value *Exception = CGF.EmitScalarExpr(ThrowExpr); + llvm::Value *Exception = CGF.EmitObjCThrowOperand(ThrowExpr); Exception = CGF.Builder.CreateBitCast(Exception, ObjCTypes.ObjectPtrTy); CGF.EmitCallOrInvoke(ObjCTypes.getExceptionThrowFn(), Exception) .setDoesNotReturn(); |

