1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Fix for sized array initializer with global variables

This commit is contained in:
Brian Fiete 2020-05-18 09:59:59 -07:00
parent cd09529c9a
commit 3509d659ea
2 changed files with 10 additions and 2 deletions

View file

@ -720,7 +720,14 @@ void BeIRCodeGen::Read(BeValue*& beValue)
auto constStruct = mBeModule->mOwnedValues.Alloc<BeStructConstant>();
constStruct->mType = type;
for (auto val : values)
constStruct->mMemberValues.push_back(BeValueDynCast<BeConstant>(val));
{
BeConstant* constant = BeValueDynCast<BeConstant>(val);
constStruct->mMemberValues.push_back(constant);
#ifdef _DEBUG
auto memberType = constant->GetType();
BF_ASSERT(memberType == arrayType->mElementType);
#endif
}
beValue = constStruct;
BE_MEM_END("ParamType_Const_Array");
return;