mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Allow [Unchecked] bounds check disabling on sized array indexing
This commit is contained in:
parent
89b597c913
commit
46611ee8f2
1 changed files with 1 additions and 1 deletions
|
@ -20091,7 +20091,7 @@ void BfExprEvaluator::Visit(BfIndexerExpression* indexerExpr)
|
|||
auto indexConst = mModule->mBfIRBuilder->GetConstant(indexArgument.mValue);
|
||||
if (indexConst->mUInt64 >= (uint64)sizedArrayType->mElementCount)
|
||||
{
|
||||
if (!mModule->IsInSpecializedSection())
|
||||
if ((!mModule->IsInSpecializedSection()) && (checkedKind != BfCheckedKind_Unchecked))
|
||||
{
|
||||
mModule->Fail(StrFormat("Index '%d' is out of bounds for type '%s'", indexConst->mInt32, mModule->TypeToString(target.mType).c_str()), indexerExpr->mArguments[0]);
|
||||
mResult = _GetDefaultResult();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue