mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
Fixed const stride issues
This commit is contained in:
parent
e60bbdf64f
commit
8c700e6deb
5 changed files with 34 additions and 3 deletions
|
@ -1880,8 +1880,14 @@ void BeCOFFObject::WriteConst(BeCOFFSection& sect, BeConstant* constVal)
|
|||
}
|
||||
else if (constStruct->mType->mTypeCode == BeTypeCode_SizedArray)
|
||||
{
|
||||
BeSizedArrayType* arrayType = (BeSizedArrayType*)constStruct->mType;
|
||||
for (auto& memberVal : constStruct->mMemberValues)
|
||||
{
|
||||
WriteConst(sect, memberVal);
|
||||
int padding = arrayType->mElementType->GetStride() - arrayType->mElementType->mSize;
|
||||
if (padding > 0)
|
||||
sect.mData.WriteZeros(padding);
|
||||
}
|
||||
}
|
||||
else
|
||||
BF_FATAL("Invalid StructConst type");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue