mirror of https://github.com/cemu-project/Cemu.git
PPCRec: Avoid relying on undefined behavior in std::copy_backwards
This commit is contained in:
parent
a05b6558c4
commit
83569ae66b
|
@ -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…
Reference in New Issue