1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-15 23:04:09 +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,6 +20376,7 @@ 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();
if (typedVal.mValue.mId < methodState->mLocals.mSize)
localVar = methodState->mLocals[typedVal.mValue.mId]; localVar = methodState->mLocals[typedVal.mValue.mId];
} }