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

Fixed some const vector and static vector issues

This commit is contained in:
Brian Fiete 2021-01-01 16:39:04 -08:00
parent 3b1a5fd4d6
commit 9d3b693cfa
4 changed files with 206 additions and 178 deletions

View file

@ -816,6 +816,17 @@ void BeIRCodeGen::Read(BeValue*& beValue)
values.push_back(lastValue);
}
}
else if (type->IsVector())
{
auto vecType = (BeVectorType*)type;
int fillCount = (int)(vecType->mLength - values.size());
if (fillCount > 0)
{
auto lastValue = values.back();
for (int i = 0; i < fillCount; i++)
values.push_back(lastValue);
}
}
else
{
BF_ASSERT(type->IsStruct());
@ -835,8 +846,15 @@ void BeIRCodeGen::Read(BeValue*& beValue)
auto memberType = constant->GetType();
BF_ASSERT(memberType == arrayType->mElementType);
}
else if (type->IsVector())
{
auto vecType = (BeVectorType*)type;
auto memberType = constant->GetType();
BF_ASSERT(memberType == vecType->mElementType);
}
else
{
BF_ASSERT(type->IsStruct());
auto structType = (BeStructType*)type;
auto memberType = constant->GetType();
BF_ASSERT(memberType == structType->mMembers[i].mType);