summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-06-07 22:02:01 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-06-07 22:02:01 +0000
commitbe21aa34a0863350027179d1f85599e3bd370e83 (patch)
treec68535912b15c4250e748ac7d29822a39c3ca381 /clang/lib/CodeGen/CGObjC.cpp
parent861294035728aa5ea5ef76cccd4fbd9def1510d2 (diff)
downloadbcm5719-llvm-be21aa34a0863350027179d1f85599e3bd370e83.tar.gz
bcm5719-llvm-be21aa34a0863350027179d1f85599e3bd370e83.zip
When using property-dot assignment syntax to call a setter method,
type of rhs need be compared to setter's argument and not the getter type. Fixes radar 8062778 llvm-svn: 105560
Diffstat (limited to 'clang/lib/CodeGen/CGObjC.cpp')
-rw-r--r--clang/lib/CodeGen/CGObjC.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp
index 7c842a94986..95be0dd1204 100644
--- a/clang/lib/CodeGen/CGObjC.cpp
+++ b/clang/lib/CodeGen/CGObjC.cpp
@@ -595,7 +595,8 @@ void CodeGenFunction::EmitObjCPropertySet(const Expr *Exp,
Args);
} else if (const ObjCImplicitSetterGetterRefExpr *E =
dyn_cast<ObjCImplicitSetterGetterRefExpr>(Exp)) {
- Selector S = E->getSetterMethod()->getSelector();
+ const ObjCMethodDecl *SetterMD = E->getSetterMethod();
+ Selector S = SetterMD->getSelector();
CallArgList Args;
llvm::Value *Receiver;
if (E->getInterfaceDecl()) {
@@ -606,7 +607,8 @@ void CodeGenFunction::EmitObjCPropertySet(const Expr *Exp,
return;
} else
Receiver = EmitScalarExpr(E->getBase());
- Args.push_back(std::make_pair(Src, E->getType()));
+ ObjCMethodDecl::param_iterator P = SetterMD->param_begin();
+ Args.push_back(std::make_pair(Src, (*P)->getType()));
CGM.getObjCRuntime().GenerateMessageSend(*this, ReturnValueSlot(),
getContext().VoidTy, S,
Receiver,
OpenPOWER on IntegriCloud