mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 14:24:10 +02:00
Fixed append alloc array size calculation
This commit is contained in:
parent
234b3591eb
commit
826a7e6fba
1 changed files with 2 additions and 2 deletions
|
@ -617,7 +617,7 @@ public:
|
||||||
{
|
{
|
||||||
curAlign = resultType->mAlign;
|
curAlign = resultType->mAlign;
|
||||||
EmitAppendAlign(resultType->mAlign);
|
EmitAppendAlign(resultType->mAlign);
|
||||||
sizeValue = mModule->mBfIRBuilder->CreateMul(mModule->GetConstValue(resultType->mSize), allocCount);
|
sizeValue = mModule->mBfIRBuilder->CreateMul(mModule->GetConstValue(resultType->GetStride()), allocCount);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -633,7 +633,7 @@ public:
|
||||||
int arrayClassSize = arrayType->mInstSize - firstElementField->mDataSize;
|
int arrayClassSize = arrayType->mInstSize - firstElementField->mDataSize;
|
||||||
|
|
||||||
sizeValue = mModule->GetConstValue(arrayClassSize);
|
sizeValue = mModule->GetConstValue(arrayClassSize);
|
||||||
BfIRValue elementDataSize = mModule->mBfIRBuilder->CreateMul(mModule->GetConstValue(resultType->mSize), allocCount);
|
BfIRValue elementDataSize = mModule->mBfIRBuilder->CreateMul(mModule->GetConstValue(resultType->GetStride()), allocCount);
|
||||||
sizeValue = mModule->mBfIRBuilder->CreateAdd(sizeValue, elementDataSize);
|
sizeValue = mModule->mBfIRBuilder->CreateAdd(sizeValue, elementDataSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue