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

Fixed sized array OOB check with undef index

This commit is contained in:
Brian Fiete 2024-10-25 07:40:12 -04:00
parent eb9ad2b6c2
commit c73968a515

View file

@ -22135,7 +22135,7 @@ void BfExprEvaluator::HandleIndexerExpression(BfIndexerExpression* indexerExpr,
if (indexArgument.mValue.IsConst()) if (indexArgument.mValue.IsConst())
{ {
auto indexConst = mModule->mBfIRBuilder->GetConstant(indexArgument.mValue); auto indexConst = mModule->mBfIRBuilder->GetConstant(indexArgument.mValue);
if (indexConst->mUInt64 >= (uint64)sizedArrayType->mElementCount) if ((BfIRBuilder::IsIntable(indexConst->mTypeCode)) && (indexConst->mUInt64 >= (uint64)sizedArrayType->mElementCount))
{ {
if ((!mModule->IsInSpecializedSection()) && (checkedKind != BfCheckedKind_Unchecked)) if ((!mModule->IsInSpecializedSection()) && (checkedKind != BfCheckedKind_Unchecked))
{ {