diff options
author | John McCall <rjmccall@apple.com> | 2012-07-31 00:33:55 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2012-07-31 00:33:55 +0000 |
commit | ff755cda9c624dd807360bf09717e808dff1665a (patch) | |
tree | 5437d89ad07c58aaebc845c968dc2605628fbf88 /clang/lib/CodeGen/CGCall.cpp | |
parent | 9d192e1a900de29419c78674e80e514398cba936 (diff) | |
download | bcm5719-llvm-ff755cda9c624dd807360bf09717e808dff1665a.tar.gz bcm5719-llvm-ff755cda9c624dd807360bf09717e808dff1665a.zip |
Don't crash *or* insert a bogus autorelease when emitting a
this-adjustment thunk in ARC++.
llvm-svn: 161014
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 37a9a5eaff0..9deec19bf80 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -1405,7 +1405,8 @@ static llvm::Value *tryEmitFusedAutoreleaseOfResult(CodeGenFunction &CGF, static llvm::Value *tryRemoveRetainOfSelf(CodeGenFunction &CGF, llvm::Value *result) { // This is only applicable to a method with an immutable 'self'. - const ObjCMethodDecl *method = dyn_cast<ObjCMethodDecl>(CGF.CurCodeDecl); + const ObjCMethodDecl *method = + dyn_cast_or_null<ObjCMethodDecl>(CGF.CurCodeDecl); if (!method) return 0; const VarDecl *self = method->getSelfDecl(); if (!self->getType().isConstQualified()) return 0; |