From 0f83458513846bf18dc3b72c4b19845bfa65ad4e Mon Sep 17 00:00:00 2001 From: svenbarth Date: Wed, 26 Dec 2018 22:59:48 +0000 Subject: [PATCH] * previous Invoke() related commit also correctly fixed Mantis #34509 git-svn-id: trunk@40670 - --- .gitattributes | 1 + tests/webtbs/tw34509.pp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 tests/webtbs/tw34509.pp diff --git a/.gitattributes b/.gitattributes index fb9d172c4e..313da82c1d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/tests/webtbs/tw34509.pp b/tests/webtbs/tw34509.pp new file mode 100644 index 0000000000..24fd605f79 --- /dev/null +++ b/tests/webtbs/tw34509.pp @@ -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.