1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed mUnassignedFieldFlags handling of fields in extensions

This commit is contained in:
Brian Fiete 2025-02-22 10:24:19 -08:00
parent fb088935d3
commit 0dcc7c4df3

View file

@ -2297,7 +2297,14 @@ bool BfModule::TryLocalVariableInit(BfLocalVariable* localVar)
{
if (fieldInstance.mMergedDataIdx != -1)
{
int64 checkMask = (int64)1 << fieldInstance.mMergedDataIdx;
int64 checkMask = 1;
if (auto fieldTypeInst = fieldInstance.mResolvedType->ToTypeInstance())
{
if (fieldTypeInst->IsValueType())
checkMask = (1 << fieldTypeInst->mMergedFieldDataCount) - 1;
}
checkMask <<= fieldInstance.mMergedDataIdx;
if ((localVar->mUnassignedFieldFlags & checkMask) != 0)
{
// For fields added in extensions, we automatically initialize those if necessary