aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCXX.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-12-08 06:46:18 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-12-08 06:46:18 +0000
commit77a259c6dbf582949af8a243b472c0c7faa373a6 (patch)
treee0e4b3ac854d9934aac71b20bd9ea21092129208 /lib/CodeGen/CGCXX.cpp
parent7ac1c9ef0bd250da82ddf3f5213182278e351753 (diff)
Fix for PR5707: make sure implicit copy constructors initialize the vtable
pointer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90840 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXX.cpp')
-rw-r--r--lib/CodeGen/CGCXX.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp
index 0b77584dd9..bd166d08ef 100644
--- a/lib/CodeGen/CGCXX.cpp
+++ b/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;