mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Fix uninitialized data in packing holes in BfVariant structs
This commit is contained in:
parent
979818388e
commit
f06e5efd2f
1 changed files with 3 additions and 1 deletions
|
@ -12945,7 +12945,9 @@ BfVariant BfModule::TypedValueToVariant(BfAstNode* refNode, const BfTypedValue&
|
|||
}
|
||||
else
|
||||
{
|
||||
BfVariant::StructData* structData = (BfVariant::StructData*)(new uint8[value.mType->mSize + 4]);
|
||||
int allocSize = value.mType->mSize + 4;
|
||||
BfVariant::StructData* structData = (BfVariant::StructData*)(new uint8[allocSize]);
|
||||
memset(structData, 0, allocSize);
|
||||
structData->mSize = value.mType->mSize;
|
||||
mBfIRBuilder->WriteConstant(value.mValue, structData->mData, value.mType);
|
||||
variant.mTypeCode = BfTypeCode_Struct;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue