зеркало из https://github.com/microsoft/clang-1.git
Fix case where the alignment is overaligned, per Eli's suggestion.
rdar://11220251 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154893 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
07d2f56717
Коммит
26397edfea
|
@ -238,7 +238,10 @@ void AggExprEmitter::EmitMoveFromReturnSlot(const Expr *E, RValue Src) {
|
|||
|
||||
// Otherwise, do a final copy,
|
||||
assert(Dest.getAddr() != Src.getAggregateAddr());
|
||||
EmitFinalDestCopy(E, Src, /*Ignore*/ true, Dest.getAlignment().getQuantity());
|
||||
std::pair<CharUnits, CharUnits> TypeInfo =
|
||||
CGF.getContext().getTypeInfoInChars(E->getType());
|
||||
CharUnits Alignment = std::min(TypeInfo.second, Dest.getAlignment());
|
||||
EmitFinalDestCopy(E, Src, /*Ignore*/ true, Alignment.getQuantity());
|
||||
}
|
||||
|
||||
/// EmitFinalDestCopy - Perform the final copy to DestPtr, if desired.
|
||||
|
|
Загрузка…
Ссылка в новой задаче