]> granicus.if.org Git - clang/commitdiff
objective-c IRGen. Fixes a getter synthesis bug
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 26 Apr 2012 21:33:14 +0000 (21:33 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 26 Apr 2012 21:33:14 +0000 (21:33 +0000)
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

lib/CodeGen/CGObjC.cpp

index fc274a93a8a7701a5bc6b4958fa3a21b3a4f479b..a10822b7576926691f40580b09563a2f45d26d40 100644 (file)
@@ -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);