mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-27 13:10:32 +02:00
* fix for Mantis #31118: applied patch by Maciej Izak to fix usage of wrong variable
+ added test git-svn-id: trunk@35133 -
This commit is contained in:
parent
cabcc52db1
commit
121a857af8
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -13007,6 +13007,7 @@ tests/test/trstr7.pp svneol=native#text/plain
|
|||||||
tests/test/trstr8.pp svneol=native#text/plain
|
tests/test/trstr8.pp svneol=native#text/plain
|
||||||
tests/test/trtti1.pp svneol=native#text/plain
|
tests/test/trtti1.pp svneol=native#text/plain
|
||||||
tests/test/trtti10.pp svneol=native#text/pascal
|
tests/test/trtti10.pp svneol=native#text/pascal
|
||||||
|
tests/test/trtti11.pp svneol=native#text/pascal
|
||||||
tests/test/trtti2.pp svneol=native#text/plain
|
tests/test/trtti2.pp svneol=native#text/plain
|
||||||
tests/test/trtti3.pp svneol=native#text/plain
|
tests/test/trtti3.pp svneol=native#text/plain
|
||||||
tests/test/trtti4.pp svneol=native#text/plain
|
tests/test/trtti4.pp svneol=native#text/plain
|
||||||
|
@ -116,7 +116,7 @@ begin
|
|||||||
{ check terminator, maybe we are already in init table }
|
{ check terminator, maybe we are already in init table }
|
||||||
if Assigned(PRecordInfoInit(typeInfo)^.Terminator) then
|
if Assigned(PRecordInfoInit(typeInfo)^.Terminator) then
|
||||||
{ point to more optimal initrtti }
|
{ point to more optimal initrtti }
|
||||||
result:=PRecordInfoFull(result)^.InitTable;
|
result:=PRecordInfoFull(typeInfo)^.InitTable;
|
||||||
{$endif VER3_0}
|
{$endif VER3_0}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
28
tests/test/trtti11.pp
Normal file
28
tests/test/trtti11.pp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
program trtti11;
|
||||||
|
|
||||||
|
{$MODE DELPHI}
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils;
|
||||||
|
|
||||||
|
type
|
||||||
|
PFoo = ^TFoo;
|
||||||
|
TFoo = packed record
|
||||||
|
public
|
||||||
|
F: Integer;
|
||||||
|
S: string;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
PF: PFoo;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
GetMem(PF, SizeOf(TFoo));
|
||||||
|
InitializeArray(PF, TypeInfo(TFoo), 1);
|
||||||
|
PF.S := 'foo';
|
||||||
|
FinalizeArray(PF, TypeInfo(TFoo), 1);
|
||||||
|
FreeMem(PF);
|
||||||
|
except
|
||||||
|
Halt(1);
|
||||||
|
end;
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user