mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 00:20:40 +03:00
Fix size of classes
This commit is contained in:
parent
b03babcab6
commit
12984d9cc7
2 changed files with 4 additions and 0 deletions
|
@ -737,6 +737,9 @@ void ClassDeclaration::semantic(Scope *sc)
|
||||||
alignsize = thissize;
|
alignsize = thissize;
|
||||||
}
|
}
|
||||||
structsize = sc->offset;
|
structsize = sc->offset;
|
||||||
|
#if IN_LLVM
|
||||||
|
structsize = (structsize + structalign - 1) & ~(structalign - 1);
|
||||||
|
#endif
|
||||||
sizeok = 1;
|
sizeok = 1;
|
||||||
Module::dprogress++;
|
Module::dprogress++;
|
||||||
|
|
||||||
|
|
|
@ -1592,6 +1592,7 @@ size_t realignOffset(size_t offset, Type* type)
|
||||||
// if it differs we need to insert manual padding as well
|
// if it differs we need to insert manual padding as well
|
||||||
if (alignsize != alignsize2)
|
if (alignsize != alignsize2)
|
||||||
{
|
{
|
||||||
|
// FIXME: this assert fails on std.typecons
|
||||||
//assert(alignsize > alignsize2 && "this is not good, the D and LLVM "
|
//assert(alignsize > alignsize2 && "this is not good, the D and LLVM "
|
||||||
// "type alignments differ, but LLVM's is bigger! This will break "
|
// "type alignments differ, but LLVM's is bigger! This will break "
|
||||||
// "aggregate type mapping");
|
// "aggregate type mapping");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue