Skip to content

Commit d07bd57

Browse files
committed
Reenable asm packarray for fpc > 3.1. Recent fpc now have the same behavior as delphi
1 parent e0e43d8 commit d07bd57

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Source/VTConfig.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
{$ifdef Windows}
4545
{$define EnableThreadSupport}
4646
{$endif}
47-
{$if (FPC_FULLVERSION >= 30100) or defined(CPU64) or defined(LCLCarbon)}
47+
{$if defined(CPU64) or defined(LCLCarbon)}
4848
{$define PACKARRAYPASCAL}
4949
{$endif}
5050

Source/VirtualTrees.pas

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13794,8 +13794,12 @@ function TBaseVirtualTree.PackArray(TheArray: TNodeArray; Count: Integer): Integ
1379413794
PUSH EBX
1379513795
PUSH EDI
1379613796
PUSH ESI
13797-
MOV ECX, EDX //fpc: count is in EDX. Move to ECX
13798-
MOV ESI, [EBP+8] //fpc: TheArray is in EBP+8
13797+
{$if FPC_FULLVERSION >= 30100}
13798+
MOV ESI, EDX
13799+
{$else}
13800+
MOV ECX, EDX //fpc < 3.1: count is in EDX. Move to ECX
13801+
MOV ESI, [EBP+8] //fpc < 3.1: TheArray is in EBP+8
13802+
{$endif}
1379913803
MOV EDX, -1
1380013804
JCXZ @@Finish // Empty list?
1380113805
INC EDX // init remaining entries counter

0 commit comments

Comments
 (0)