diff options
author | Anders Carlsson <andersca@mac.com> | 2010-06-21 20:59:55 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-06-21 20:59:55 +0000 |
commit | 7e70fb217dcdf96faf34df3e197c3831c86f8089 (patch) | |
tree | 2b704e41775d9354075e4d1c13b78aae0313196a /lib/CodeGen/CGObjCMac.cpp | |
parent | 9a140845438c2fc31e7d48a6dedbc695f4c83c68 (diff) |
Fix an Obj-C++ miscompile when calling an Obj-C method that returns a C++ reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106477 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCMac.cpp')
-rw-r--r-- | lib/CodeGen/CGObjCMac.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 8374aa8c55..cd27dcef01 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -1634,6 +1634,11 @@ CGObjCCommonMac::EmitLegacyMessageSend(CodeGen::CodeGenFunction &CGF, const llvm::FunctionType *FTy = Types.GetFunctionType(FnInfo, Method ? Method->isVariadic() : false); + if (Method) + assert(CGM.getContext().getCanonicalType(Method->getResultType()) == + CGM.getContext().getCanonicalType(ResultType) && + "Result type mismatch!"); + llvm::Constant *Fn = NULL; if (CGM.ReturnTypeUsesSret(FnInfo)) { Fn = (ObjCABI == 2) ? ObjCTypes.getSendStretFn2(IsSuper) |