From: Fariborz Jahanian Date: Thu, 26 Apr 2012 21:33:14 +0000 (+0000) Subject: objective-c IRGen. Fixes a getter synthesis bug X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=52c18b0933006acaf5c865f6e86a4694b5f288e7;p=clang objective-c IRGen. Fixes a getter synthesis bug where getter type is super class of its property type, resulting in an assert. // rdar://11323676 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155663 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index fc274a93a8..a10822b757 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -859,7 +859,7 @@ CodeGenFunction::generateObjCGetterBody(const ObjCImplementationDecl *classImpl, // always objects so we don't need to worry about complex or // aggregates. RV = RValue::get(Builder.CreateBitCast(RV.getScalarVal(), - getTypes().ConvertType(propType))); + getTypes().ConvertType(getterMethod->getResultType()))); EmitReturnOfRValue(RV, propType);