1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 20:12:21 +02:00

Fixed field initializer crash

This commit is contained in:
Brian Fiete 2020-06-17 05:24:18 -07:00
parent abeda6909b
commit a29f22d227

View file

@ -3802,10 +3802,10 @@ BfTypedValue BfModule::GetFieldInitializerValue(BfFieldInstance* fieldInstance,
if (fieldInstance != NULL) if (fieldInstance != NULL)
MarkFieldInitialized(fieldInstance); MarkFieldInitialized(fieldInstance);
if (doStore) if ((doStore) && (result))
{ {
result = LoadValue(result); result = LoadValue(result);
if (!result.mType->IsValuelessType()) if (!result.mType->IsValuelessType())
mBfIRBuilder->CreateStore(result.mValue, staticVarRef.mValue); mBfIRBuilder->CreateStore(result.mValue, staticVarRef.mValue);
} }