1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

^ From End index is relative to length instead of length-1

This commit is contained in:
Brian Fiete 2021-10-26 06:15:36 -07:00
parent fa3198f82a
commit 299bea0eaa
6 changed files with 30 additions and 27 deletions

View file

@ -20859,7 +20859,7 @@ void BfExprEvaluator::PerformBinaryOperation(BfExpression* leftExpression, BfExp
}
else
{
// Add as a `^0`
// Add as a `^1`
auto indexType = mModule->ResolveTypeDef(mModule->mCompiler->mIndexTypeDef)->ToTypeInstance();
rightTypedValueExpr.mRefNode = opToken;
@ -20867,7 +20867,7 @@ void BfExprEvaluator::PerformBinaryOperation(BfExpression* leftExpression, BfExp
SizedArray<BfIRValue, 8> tupleMembers;
tupleMembers.Add(valueTypeEmpty);
tupleMembers.Add(mModule->mBfIRBuilder->CreateConst(BfTypeCode_IntPtr, 0));
tupleMembers.Add(mModule->mBfIRBuilder->CreateConst(BfTypeCode_IntPtr, 1));
auto tupleValue = mModule->mBfIRBuilder->CreateConstAgg(mModule->mBfIRBuilder->MapType(indexType->mFieldInstances[0].mResolvedType), tupleMembers);
SizedArray<BfIRValue, 8> indexMembers;