mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-19 01:49:22 +02:00
* previous Invoke() related commit also correctly fixed Mantis #34509
git-svn-id: trunk@40670 -
This commit is contained in:
parent
9eac2ea852
commit
0f83458513
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -16446,6 +16446,7 @@ tests/webtbs/tw34438.pp svneol=native#text/pascal
|
|||||||
tests/webtbs/tw3444.pp svneol=native#text/plain
|
tests/webtbs/tw3444.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw34442.pp svneol=native#text/plain
|
tests/webtbs/tw34442.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw34496.pp svneol=native#text/pascal
|
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/tw3456.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3457.pp svneol=native#text/plain
|
tests/webtbs/tw3457.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3460.pp svneol=native#text/plain
|
tests/webtbs/tw3460.pp svneol=native#text/plain
|
||||||
|
33
tests/webtbs/tw34509.pp
Normal file
33
tests/webtbs/tw34509.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user