Codegen assignment to self correctly, patch by David Chisnall!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49201 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp
index cc7d8e9..a50e666 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -484,8 +484,7 @@
llvm::Value *SelPtr = Builder.CreateStructGEP(Selector, 0);
return Runtime->generateMessageSend(Builder, ConvertType(E->getType()),
- // FIXME: Self can be assigned to!
- CGF.CurFn->arg_begin(),
+ CGF.LoadObjCSelf(),
Receiver, SelPtr,
&Args[0], Args.size());
}