microvu: fix ASAN container-overflow in mVUsetupRange

This commit is contained in:
oltolm 2024-09-16 00:20:20 +02:00 committed by Ty
parent 158e67cf6d
commit 4c267c4206
1 changed files with 3 additions and 5 deletions

View File

@ -81,11 +81,9 @@ void mVUsetupRange(microVU& mVU, s32 pc, bool isStartPC)
if (mVUrange.start <= cur_pc) if (mVUrange.start <= cur_pc)
{ {
mVUrange.end = cur_pc; mVUrange.end = cur_pc;
s32& rStart = mVUrange.start; s32 rStart = mVUrange.start;
s32& rEnd = mVUrange.end; s32 rEnd = mVUrange.end;
std::deque<microRange>::iterator it(ranges->begin()); for (auto it = ranges->begin() + 1; it != ranges->end();)
it++;
for (;it != ranges->end();)
{ {
if (((it->start >= rStart) && (it->start <= rEnd)) || ((it->end >= rStart) && (it->end <= rEnd))) // Starts after this prog but starts before the end of current prog if (((it->start >= rStart) && (it->start <= rEnd)) || ((it->end >= rStart) && (it->end <= rEnd))) // Starts after this prog but starts before the end of current prog
{ {