aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-02-26 09:12:15 +0000
committerJohn McCall <rjmccall@apple.com>2011-02-26 09:12:15 +0000
commita1bcc4ddb1ed8be9be6950232941d80a04f80819 (patch)
treeb8799bd828722d2bbb3f6ab5cad4d8e45bd060e5 /lib
parent92ee7ca6f42d2bd735f9bfc120c00838c4e469c0 (diff)
Zero-initialize the struct-return slot of an Objective-C message
send before making the call. Fixes rdar://problem/7854674 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126543 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/CGObjCMac.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index 7c679b9059..f5befceb0f 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -1639,6 +1639,7 @@ CGObjCCommonMac::EmitLegacyMessageSend(CodeGen::CodeGenFunction &CGF,
llvm::Constant *Fn = NULL;
if (CGM.ReturnTypeUsesSRet(FnInfo)) {
+ CGF.EmitNullInitialization(Return.getValue(), ResultType);
Fn = (ObjCABI == 2) ? ObjCTypes.getSendStretFn2(IsSuper)
: ObjCTypes.getSendStretFn(IsSuper);
} else if (CGM.ReturnTypeUsesFPRet(ResultType)) {
@@ -5629,6 +5630,7 @@ CodeGen::RValue CGObjCNonFragileABIMac::EmitMessageSend(
llvm::Constant *Fn = 0;
std::string Name("\01l_");
if (CGM.ReturnTypeUsesSRet(FnInfo)) {
+ CGF.EmitNullInitialization(Return.getValue(), ResultType);
if (IsSuper) {
Fn = ObjCTypes.getMessageSendSuper2StretFixupFn();
Name += "objc_msgSendSuper2_stret_fixup";