Error in alignment of interface typeinfo
Original Reporter info from Mantis: DonAlfredo @DonAlfredo
-
Reporter name: Alfred
Original Reporter info from Mantis: DonAlfredo @DonAlfredo
- Reporter name: Alfred
Description:
On Linux 64 bit on aarch, the alignment of the interface rtti record is wrong, resulting in wrong typinfo data.
Steps to reproduce:
program SmallTestInterfaceRTTI;
{$mode objfpc}{$H+}
uses
classes, typinfo;
type
IMyNewMPInterface = interface(IInvokable)
['{AA503475-0187-4108-8E27-41475F4EF818}']
procedure TestStdCall(LongParaName: TObject; const B: string; var C: integer; out D: byte); stdcall;
end;
var
ti:PTypeInfo;
td : PTypeData;
begin
writeln('Starting !!');
ti:=TypeInfo(IMyNewMPInterface);
td := GetTypeData(ti);
// this gives an error (e.g. wrong data) on aarch64.
// after patch of ncgrtti.pas, data is correct (unit name)
if ti^.Kind = tkInterface then
writeln('IntfUnit: ',td^.IntfUnit)
else
writeln('IIDStr: ',td^.IIDStr);
writeln('Ready !');
readln;
end.
Additional information:
Patch for ncgrtti.pas is included.
No regressions detected.
Mantis conversion info:
- Mantis ID: 30182
- OS: linux 64 bit
- OS Build: Arch Linux 64
- Build: trunk
- Platform: aarch64
- Version: 3.1.1
- Fixed in version: 3.1.1
- Fixed in revision: 34695 (#5efb3228)