summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2019-03-16 19:25:39 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2019-03-16 19:25:39 +0000
commit68b4673feaaf4c16653847db3259d706229178f4 (patch)
treea3bcea0e6dd0a5c5040e63f4f6c45fdf621c4c2d /clang/lib/CodeGen
parent3b0a6c69ee54fbe3a873adca35fa9b282121fb3d (diff)
downloadbcm5719-llvm-68b4673feaaf4c16653847db3259d706229178f4.tar.gz
bcm5719-llvm-68b4673feaaf4c16653847db3259d706229178f4.zip
CodeGen: Preserve packed attribute in constStructWithPadding.
Otherwise the object may have an incorrect size due to tail padding. Differential Revision: https://reviews.llvm.org/D59446 llvm-svn: 356328
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index c09077bb8a5..80bdedebbcd 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -1113,7 +1113,7 @@ static llvm::Constant *constStructWithPadding(CodeGenModule &CGM,
}
if (NestedIntact && Values.size() == STy->getNumElements())
return constant;
- return llvm::ConstantStruct::getAnon(Values);
+ return llvm::ConstantStruct::getAnon(Values, STy->isPacked());
}
/// Replace all padding bytes in a given constant with either a pattern byte or
OpenPOWER on IntegriCloud