* previous Invoke() related commit also correctly fixed Mantis #34509

git-svn-id: trunk@40670 -
This commit is contained in:
svenbarth 2018-12-26 22:59:48 +00:00
parent 9eac2ea852
commit 0f83458513
2 changed files with 34 additions and 0 deletions

1
.gitattributes vendored
View File

@ -16446,6 +16446,7 @@ tests/webtbs/tw34438.pp svneol=native#text/pascal
tests/webtbs/tw3444.pp svneol=native#text/plain
tests/webtbs/tw34442.pp svneol=native#text/plain
tests/webtbs/tw34496.pp svneol=native#text/pascal
tests/webtbs/tw34509.pp svneol=native#text/pascal
tests/webtbs/tw3456.pp svneol=native#text/plain
tests/webtbs/tw3457.pp svneol=native#text/plain
tests/webtbs/tw3460.pp svneol=native#text/plain

33
tests/webtbs/tw34509.pp Normal file
View File

@ -0,0 +1,33 @@
{ %TARGET = win64 }
program tw34509;
{$MODE DELPHI}
uses
TypInfo,
RTTI;
type
TRec = record
S: string;
I: Integer;
end;
function Test(P: TRec): TRec;
begin
Result := P;
WriteLn('P: ', P.S, ' - ', P.I);
end;
var
V: TValue;
R1, R2: TRec;
begin
R1.S := 'abc';
R1.I := 123;
TValue.Make(@R1, TypeInfo(TRec), V);
R2 := TRec(Rtti.Invoke(@Test, [V], ccReg, TypeInfo(TRec), True, False).GetReferenceToRawData^);
WriteLn('R: ', R2.S, ' - ', R2.I);
//ReadLn;
end.