Explorar o código

* Move() check for identical index. Additional fix for #39617

Michaël Van Canneyt %!s(int64=3) %!d(string=hai) anos
pai
achega
59a7024d73
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      rtl/objpas/classes/lists.inc

+ 2 - 0
rtl/objpas/classes/lists.inc

@@ -261,6 +261,8 @@ var
 begin
   CheckIndex(CurIndex);
   CheckIndex(NewIndex);
+  if (CurIndex=NewIndex) then 
+    exit;
   Temp := FList^[CurIndex];
   if NewIndex > CurIndex then
     System.Move(FList^[CurIndex+1], FList^[CurIndex], (NewIndex - CurIndex) * SizeOf(Pointer))