From 83569ae66b69c547af5d9ec53e05c2979d142c07 Mon Sep 17 00:00:00 2001 From: Exzap <13877693+Exzap@users.noreply.github.com> Date: Wed, 30 Oct 2024 02:41:43 +0100 Subject: [PATCH] PPCRec: Avoid relying on undefined behavior in std::copy_backwards --- src/Cafe/HW/Espresso/Recompiler/IML/IMLOptimizer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Cafe/HW/Espresso/Recompiler/IML/IMLOptimizer.cpp b/src/Cafe/HW/Espresso/Recompiler/IML/IMLOptimizer.cpp index cb61fecf..f2cf173a 100644 --- a/src/Cafe/HW/Espresso/Recompiler/IML/IMLOptimizer.cpp +++ b/src/Cafe/HW/Espresso/Recompiler/IML/IMLOptimizer.cpp @@ -611,7 +611,8 @@ sint32 IMLUtil_MoveInstructionTo(IMLSegment& seg, sint32 initialIndex, sint32 ta { cemu_assert_debug(targetIndex > 0); targetIndex--; - std::copy_backward(seg.imlList.begin() + initialIndex + 1, seg.imlList.begin() + targetIndex + 1, seg.imlList.begin() + targetIndex); + for(size_t i=initialIndex; i