Start at NextOffset when laying out bases as well.

llvm-svn: 82831
This commit is contained in:
Anders Carlsson 2009-09-26 01:29:10 +00:00
parent 73b6b4e1a3
commit 7f78d85be4
2 changed files with 5 additions and 1 deletions

View File

@ -377,7 +377,7 @@ uint64_t ASTRecordLayoutBuilder::LayoutBase(const CXXRecordDecl *RD) {
unsigned BaseAlign = BaseInfo.getNonVirtualAlign();
// Round up the current record size to the base's alignment boundary.
uint64_t Offset = llvm::RoundUpToAlignment(Size, BaseAlign);
uint64_t Offset = llvm::RoundUpToAlignment(NextOffset, BaseAlign);
// Try to place the base.
while (true) {

View File

@ -62,3 +62,7 @@ struct S7 : Empty {
void *v;
};
SA(11, sizeof(S7) == 8);
struct S8 : Empty, A {
};
SA(12, sizeof(S8) == 4);