Make sure to set vtable pointers in the destructors as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95525 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp
index fb2c958..522fee4 100644
--- a/lib/CodeGen/CGClass.cpp
+++ b/lib/CodeGen/CGClass.cpp
@@ -1043,7 +1043,7 @@
 
   StartFunction(GlobalDecl(Dtor, DtorType), Dtor->getResultType(), Fn, Args, 
                 SourceLocation());
-
+  InitializeVtablePtrs(Dtor->getParent());
   EmitDtorEpilogue(Dtor, DtorType);
   FinishFunction();
 }
diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp
index 85db6bb..60a1016 100644
--- a/lib/CodeGen/CGException.cpp
+++ b/lib/CodeGen/CGException.cpp
@@ -473,6 +473,7 @@
       llvm::BasicBlock *DtorEpilogue  = createBasicBlock("dtor.epilogue");
       PushCleanupBlock(DtorEpilogue);
 
+      InitializeVtablePtrs(DD->getParent());
       EmitStmt(S.getTryBlock());
 
       CleanupBlockInfo Info = PopCleanupBlock();
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 44ed9db..4eeea8e 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -283,6 +283,8 @@
       llvm::BasicBlock *DtorEpilogue  = createBasicBlock("dtor.epilogue");
       PushCleanupBlock(DtorEpilogue);
 
+      InitializeVtablePtrs(DD->getParent());
+
       EmitStmt(S);
       
       CleanupBlockInfo Info = PopCleanupBlock();