From bb5008a32ac913144ba8721eb99f09f55389de3b Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 8 Dec 2009 06:46:18 +0000 Subject: Fix for PR5707: make sure implicit copy constructors initialize the vtable pointer. llvm-svn: 90840 --- clang/lib/CodeGen/CGCXX.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/lib/CodeGen/CGCXX.cpp') diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp index 0b77584dd93..bd166d08efe 100644 --- a/clang/lib/CodeGen/CGCXX.cpp +++ b/clang/lib/CodeGen/CGCXX.cpp @@ -1572,6 +1572,8 @@ CodeGenFunction::SynthesizeCXXCopyConstructor(const CXXConstructorDecl *Ctor, EmitAggregateCopy(LHS.getAddress(), RHS.getAddress(), Field->getType()); } } + + InitializeVtablePtrs(ClassDecl); FinishFunction(); } @@ -1812,6 +1814,10 @@ void CodeGenFunction::EmitCtorPrologue(const CXXConstructorDecl *CD, PopCXXTemporary(); } + InitializeVtablePtr(ClassDecl); +} + +void CodeGenFunction::InitializeVtablePtrs(const CXXRecordDecl *ClassDecl) { if (!ClassDecl->isDynamicClass()) return; -- cgit v1.2.3