1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Fixed readonly addr handling of indexer expression

This commit is contained in:
Brian Fiete 2025-06-02 06:35:33 +02:00
parent 3291ed6966
commit c53c7b4157
2 changed files with 8 additions and 1 deletions

View file

@ -15171,6 +15171,9 @@ namespace IDE
if (mUpdateCnt % 120 == 0) if (mUpdateCnt % 120 == 0)
VerifyModifiedBuffers(); VerifyModifiedBuffers();
if (!mSettings.mSettingsValid)
Stop();
if (mWantShowOutput) if (mWantShowOutput)
{ {
ShowOutput(); ShowOutput();

View file

@ -22687,7 +22687,7 @@ void BfExprEvaluator::Visit(BfIndexerExpression* indexerExpr)
void BfExprEvaluator::HandleIndexerExpression(BfIndexerExpression* indexerExpr, BfTypedValue target) void BfExprEvaluator::HandleIndexerExpression(BfIndexerExpression* indexerExpr, BfTypedValue target)
{ {
BfAstNode* refNode = indexerExpr->mOpenBracket; BfAstNode* refNode = indexerExpr->mOpenBracket;
if (refNode == NULL) if (refNode == NULL)
refNode = indexerExpr->mTarget; refNode = indexerExpr->mTarget;
@ -23048,6 +23048,8 @@ void BfExprEvaluator::HandleIndexerExpression(BfIndexerExpression* indexerExpr,
if ((sizedArrayType->IsUndefSizedArray()) || (isUndefIndex)) if ((sizedArrayType->IsUndefSizedArray()) || (isUndefIndex))
{ {
mResult = mModule->GetDefaultTypedValue(underlyingType, false, BfDefaultValueKind_Addr); mResult = mModule->GetDefaultTypedValue(underlyingType, false, BfDefaultValueKind_Addr);
if ((!target.CanModify()) && (mResult.IsAddr()))
mResult.mKind = BfTypedValueKind_ReadOnlyAddr;
} }
else if (sizedArrayType->IsValuelessType()) else if (sizedArrayType->IsValuelessType())
{ {
@ -23057,6 +23059,8 @@ void BfExprEvaluator::HandleIndexerExpression(BfIndexerExpression* indexerExpr,
{ {
mResult = mModule->GetDefaultTypedValue(underlyingType, false, BfDefaultValueKind_Addr); mResult = mModule->GetDefaultTypedValue(underlyingType, false, BfDefaultValueKind_Addr);
} }
if ((!target.CanModify()) && (mResult.IsAddr()))
mResult.mKind = BfTypedValueKind_ReadOnlyAddr;
} }
else if (target.IsAddr()) else if (target.IsAddr())
{ {