Fix #40737: make TMethodNameTable/TMethodNameTableEntry compatible with FPC 3.3.1

The change follows
170c05592b

Patch by Dean Mustakinov, issue #40737.
This commit is contained in:
rich2014 2024-02-04 21:54:10 +08:00
parent 02ddfe3ecd
commit 21fc3631d5
3 changed files with 30 additions and 6 deletions

View File

@ -267,12 +267,20 @@ begin
end;
type
tmethodnamerec = packed record
tmethodnamerec =
{$if (FPC_FULLVERSION<30301) or NOT defined(FPC_REQUIRES_PROPER_ALIGNMENT)}
packed
{$endif}
record
name : pshortstring;
addr : codepointer;
end;
tmethodnametable = packed record
tmethodnametable =
{$if (FPC_FULLVERSION<30301) or NOT defined(FPC_REQUIRES_PROPER_ALIGNMENT)}
packed
{$endif}
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 =
{$if (FPC_FULLVERSION<30301) or NOT defined(FPC_REQUIRES_PROPER_ALIGNMENT)}
packed
{$endif}
record
Name : PShortString;
Addr : Pointer;
end;
TMethodNameTable = packed record
TMethodNameTable =
{$if (FPC_FULLVERSION<30301) or NOT defined(FPC_REQUIRES_PROPER_ALIGNMENT)}
packed
{$endif}
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 =
{$if (FPC_FULLVERSION<30301) or NOT defined(FPC_REQUIRES_PROPER_ALIGNMENT)}
packed
{$endif}
record
Name: PShortstring;
Addr: Pointer;
end;
TMethodNameTable = packed record
TMethodNameTable =
{$if (FPC_FULLVERSION<30301) or NOT defined(FPC_REQUIRES_PROPER_ALIGNMENT)}
packed
{$endif}
record
Count: DWord;
Entries: packed array[0..9999999] of TMethodNameTableEntry;
end;