mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
Fixed conditional var initializer with valueless nullable
This commit is contained in:
parent
d778187e34
commit
805d312c98
2 changed files with 14 additions and 2 deletions
|
@ -1740,6 +1740,14 @@ void BeIRCodeGen::HandleNextCmd()
|
|||
CMD_PARAM(int, idx);
|
||||
|
||||
BF_ASSERT(val->GetType()->IsComposite());
|
||||
if (val->GetType()->mTypeCode == BeTypeCode_Struct)
|
||||
{
|
||||
auto structType = (BeStructType*)val->GetType();
|
||||
if (idx >= structType->mMembers.mSize)
|
||||
{
|
||||
FatalError("ExtractValue OOB");
|
||||
}
|
||||
}
|
||||
|
||||
auto extractValueInst = mBeModule->AllocInst<BeExtractValueInst>();
|
||||
extractValueInst->mAggVal = val;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue