зеркало из https://github.com/microsoft/clang-1.git
Check whether next slot meets field type's alignment requirements.
If it does not then assert at the moment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43576 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
b4292f221f
Коммит
9e124d96ab
|
@ -368,7 +368,10 @@ void RecordOrganizer::layoutStructFields(CodeGenTypes &CGT,
|
||||||
const llvm::Type *Ty = CGT.ConvertType(FD->getType());
|
const llvm::Type *Ty = CGT.ConvertType(FD->getType());
|
||||||
|
|
||||||
uint64_t Offset = RL.getFieldOffset(FieldNo);
|
uint64_t Offset = RL.getFieldOffset(FieldNo);
|
||||||
assert (Offset == Cursor && "FIXME Invalid struct layout");
|
unsigned align = CGT.getTargetData().getABITypeAlignment(Ty);
|
||||||
|
if (Cursor % align != 0)
|
||||||
|
assert (Offset == Cursor && "FIXME Invalid struct layout");
|
||||||
|
|
||||||
Cursor += CGT.getTargetData().getTypeSizeInBits(Ty);
|
Cursor += CGT.getTargetData().getTypeSizeInBits(Ty);
|
||||||
|
|
||||||
Fields.push_back(Ty);
|
Fields.push_back(Ty);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче