Pass the canonical method decl to GetVtableIndex. Fixes PR5120.

llvm-svn: 83272
This commit is contained in:
Anders Carlsson 2009-10-03 19:56:56 +00:00
parent 2ee3c011d9
commit d5931cd2b7
2 changed files with 2 additions and 2 deletions

View File

@ -298,7 +298,7 @@ void AggExprEmitter::VisitUnaryAddrOf(const UnaryOperator *E) {
llvm::Value *FuncPtr;
if (MD->isVirtual()) {
uint64_t Index = CGF.CGM.GetVtableIndex(MD);
uint64_t Index = CGF.CGM.GetVtableIndex(MD->getCanonicalDecl());
FuncPtr = llvm::ConstantInt::get(PtrDiffTy, Index + 1);
} else {

View File

@ -413,7 +413,7 @@ public:
// Get the function pointer (or index if this is a virtual function).
if (MD->isVirtual()) {
uint64_t Index = CGM.GetVtableIndex(MD);
uint64_t Index = CGM.GetVtableIndex(MD->getCanonicalDecl());
Values[0] = llvm::ConstantInt::get(PtrDiffTy, Index + 1);
} else {