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

Range check on methodState->mLocals

This commit is contained in:
Brian Fiete 2025-05-17 17:43:22 +02:00
parent 81aaefff0c
commit ee50457885

View file

@ -20376,7 +20376,8 @@ bool BfExprEvaluator::CheckModifyResult(BfTypedValue& typedVal, BfAstNode* refNo
else if (typedVal.mValue.IsArg()) else if (typedVal.mValue.IsArg())
{ {
auto methodState = mModule->mCurMethodState->GetNonCaptureState(); auto methodState = mModule->mCurMethodState->GetNonCaptureState();
localVar = methodState->mLocals[typedVal.mValue.mId]; if (typedVal.mValue.mId < methodState->mLocals.mSize)
localVar = methodState->mLocals[typedVal.mValue.mId];
} }
if ((typedVal.mKind == BfTypedValueKind_MutableValue) && (onlyNeedsMut)) if ((typedVal.mKind == BfTypedValueKind_MutableValue) && (onlyNeedsMut))