typinfo: push/pop doesn't save packrecords. also, always use AlignTypeData on m68k, which might have less than pointer sized (word, 2 byte) alignments in the typeinfo, because on most systems C compilers also use 2 byte alignments, so we need that for compatibility

git-svn-id: trunk@36594 -
This commit is contained in:
Károly Balogh 2017-06-24 23:18:12 +00:00
parent 41f72a0e6d
commit ea635bfda5

View File

@ -790,11 +790,15 @@ type
function aligntoptr(p : pointer) : pointer;inline; function aligntoptr(p : pointer) : pointer;inline;
begin begin
{$ifdef m68k}
result:=AlignTypeData(p);
{$else m68k}
{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT} {$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
result:=align(p,sizeof(p)); result:=align(p,sizeof(p));
{$else FPC_REQUIRES_PROPER_ALIGNMENT} {$else FPC_REQUIRES_PROPER_ALIGNMENT}
result:=p; result:=p;
{$endif FPC_REQUIRES_PROPER_ALIGNMENT} {$endif FPC_REQUIRES_PROPER_ALIGNMENT}
{$endif m68k}
end; end;
@ -1007,14 +1011,13 @@ end;
Function AlignTypeData(p : Pointer) : Pointer; Function AlignTypeData(p : Pointer) : Pointer;
{$push}
{$packrecords c} {$packrecords c}
type type
TAlignCheck = record TAlignCheck = record
b : byte; b : byte;
q : qword; q : qword;
end; end;
{$pop} {$packrecords default}
begin begin
{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT} {$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
{$ifdef VER3_0} {$ifdef VER3_0}