mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Fix unions with base types
This commit is contained in:
parent
e6cbf0509b
commit
f9d5b58102
3 changed files with 17 additions and 4 deletions
|
@ -5433,8 +5433,8 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
{
|
||||
BF_ASSERT(resolvedFieldType->mSize >= 0);
|
||||
|
||||
if (alignSize > 1)
|
||||
dataPos = (dataPos + (alignSize - 1)) & ~(alignSize - 1);
|
||||
// if (alignSize > 1)
|
||||
// dataPos = (dataPos + (alignSize - 1)) & ~(alignSize - 1);
|
||||
fieldInstance->mDataOffset = dataPos;
|
||||
|
||||
typeInstance->mInstAlign = std::max(typeInstance->mInstAlign, alignSize);
|
||||
|
@ -5623,7 +5623,7 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
|
||||
if (unionInnerType != NULL)
|
||||
{
|
||||
dataPos = unionInnerType->mSize;
|
||||
dataPos = startDataPos + unionInnerType->mSize;
|
||||
typeInstance->mInstAlign = BF_MAX(unionInnerType->mAlign, typeInstance->mInstAlign);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue