diff options
author | John McCall <rjmccall@apple.com> | 2012-08-21 04:10:00 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2012-08-21 04:10:00 +0000 |
commit | 929bbfb0b69165b55da3c56abf22aa10e20dadc6 (patch) | |
tree | 3ef079c0dbd094349bc721d47a330a946272cdd0 /lib/CodeGen | |
parent | db309ae1bfa7c30ed3b2b9e59a316b8fef2e56b6 (diff) |
When performing a trivial copy of a C++ type, we must be careful not
to overwrite objects that might have been allocated into the type's
tail padding. This patch is missing some potential optimizations where
the destination is provably a complete object, but it's necessary for
correctness.
Patch by Jonathan Sauer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162254 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGExprAgg.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 61f7362eca..287b6dd8c7 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -1300,9 +1300,9 @@ void CodeGenFunction::EmitAggregateCopy(llvm::Value *DestPtr, // implementation handles this case safely. If there is a libc that does not // safely handle this, we can add a target hook. - // Get size and alignment info for this aggregate. + // Get data size and alignment info for this aggregate. std::pair<CharUnits, CharUnits> TypeInfo = - getContext().getTypeInfoInChars(Ty); + getContext().getTypeInfoDataSizeInChars(Ty); if (alignment.isZero()) alignment = TypeInfo.second; |