From 12582bdc2e1fca260eb2437d87dab5302c37bab2 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 26 Jun 2012 19:18:25 +0000 Subject: Fix a bug in my previous patch: If we are not doing a virtual call because the member expression is qualified, call the method specified in the code, not the most derived one we can find. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159219 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprCXX.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/CodeGen/CGExprCXX.cpp') diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp index f35287d540..372eb5407c 100644 --- a/lib/CodeGen/CGExprCXX.cpp +++ b/lib/CodeGen/CGExprCXX.cpp @@ -240,6 +240,8 @@ RValue CodeGenFunction::EmitCXXMemberCallExpr(const CXXMemberCallExpr *CE, MD->isVirtual() && ME->hasQualifier()) Callee = BuildAppleKextVirtualCall(MD, ME->getQualifier(), Ty); + else if (ME->hasQualifier()) + Callee = CGM.GetAddrOfFunction(GlobalDecl(Dtor, Dtor_Complete), Ty); else { const CXXMethodDecl *DM = Dtor->getCorrespondingMethodInClass(MostDerivedClassDecl); @@ -258,6 +260,8 @@ RValue CodeGenFunction::EmitCXXMemberCallExpr(const CXXMemberCallExpr *CE, MD->isVirtual() && ME->hasQualifier()) Callee = BuildAppleKextVirtualCall(MD, ME->getQualifier(), Ty); + else if (ME->hasQualifier()) + Callee = CGM.GetAddrOfFunction(MD, Ty); else { const CXXMethodDecl *DerivedMethod = MD->getCorrespondingMethodInClass(MostDerivedClassDecl); -- cgit v1.2.3