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 | f1249929c8a5d995a29f47221fee792e480b7ca5 (patch) | |
| tree | 98cf203fb7479fd183b43a4c3b28fa98f0ba832b /clang/lib/CodeGen/CGExprAgg.cpp | |
| parent | a9f521fd20b06bad2c044800b8e8ad033af24372 (diff) | |
| download | bcm5719-llvm-f1249929c8a5d995a29f47221fee792e480b7ca5.tar.gz bcm5719-llvm-f1249929c8a5d995a29f47221fee792e480b7ca5.zip | |
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.
llvm-svn: 162254
Diffstat (limited to 'clang/lib/CodeGen/CGExprAgg.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGExprAgg.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp index 61f7362ecae..287b6dd8c7c 100644 --- a/clang/lib/CodeGen/CGExprAgg.cpp +++ b/clang/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; |

