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

Fix for valueless array allocations

This commit is contained in:
Brian Fiete 2020-02-17 14:49:59 -08:00
parent fe531be4ef
commit 6dd49f5d9b
4 changed files with 21 additions and 12 deletions

View file

@ -1396,6 +1396,11 @@ void BeIRCodeGen::HandleNextCmd()
{
CMD_PARAM(BeType*, type);
CMD_PARAM(BeValue*, arraySize);
if (auto constant = BeValueDynCast<BeConstant>(arraySize))
{
//BF_ASSERT(constant->mInt64 >= 0);
}
auto allocaInst = mBeModule->AllocInst<BeAllocaInst>();
allocaInst->mType = type;