mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-04-29 14:59:26 -04:00
PPCRec: Avoid relying on undefined behavior in std::copy_backwards
This commit is contained in:
parent
71a57f2dfd
commit
9d1d7fc000
1 changed files with 2 additions and 1 deletions
|
@ -611,7 +611,8 @@ sint32 IMLUtil_MoveInstructionTo(IMLSegment& seg, sint32 initialIndex, sint32 ta
|
||||||
{
|
{
|
||||||
cemu_assert_debug(targetIndex > 0);
|
cemu_assert_debug(targetIndex > 0);
|
||||||
targetIndex--;
|
targetIndex--;
|
||||||
std::copy_backward(seg.imlList.begin() + initialIndex + 1, seg.imlList.begin() + targetIndex + 1, seg.imlList.begin() + targetIndex);
|
for(size_t i=initialIndex; i<targetIndex; i++)
|
||||||
|
seg.imlList[i] = seg.imlList[i+1];
|
||||||
seg.imlList[targetIndex] = temp;
|
seg.imlList[targetIndex] = temp;
|
||||||
return targetIndex;
|
return targetIndex;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue