Designer/LCL: Correctly align TMethodNameTable/TMethodNameTableEntry on platforms that require it (e.g. AARCH64).

The change follows
170c05592b

Fixes crash on IDE start on AARCH64 platforms when FPC 3.3.1 is used.

Patch by Dean Mustakinov, issue #40737.
This commit is contained in:
Maxim Ganetsky 2024-01-30 17:44:47 +03:00
parent 56887ae820
commit 8253bd9f8f
3 changed files with 30 additions and 6 deletions

View File

@ -267,12 +267,20 @@ begin
end;
type
tmethodnamerec = packed record
tmethodnamerec =
{$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
packed
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
record
name : pshortstring;
addr : codepointer;
end;
tmethodnametable = packed record
tmethodnametable =
{$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
packed
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
record
count : dword;
entries : packed array[0..0] of tmethodnamerec;
end;

View File

@ -382,12 +382,20 @@ const
type
// these definitions are copied from typinfo.pp
TMethodNameRec = packed record
TMethodNameRec =
{$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
packed
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
record
Name : PShortString;
Addr : Pointer;
end;
TMethodNameTable = packed record
TMethodNameTable =
{$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
packed
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
record
Count : DWord;
// for runtime range checking it is important to give a range
Entries : packed array[0..1000000] of TMethodNameRec;

View File

@ -204,12 +204,20 @@ begin
end;
type
TMethodNameTableEntry = packed record
TMethodNameTableEntry =
{$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
packed
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
record
Name: PShortstring;
Addr: Pointer;
end;
TMethodNameTable = packed record
TMethodNameTable =
{$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
packed
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
record
Count: DWord;
Entries: packed array[0..9999999] of TMethodNameTableEntry;
end;