blob: e1b90ec7a8e5713dffb6f74152ef5ce92729608b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
{$ifdef fpc}{$MODE OBJFPC }{$endif}
type
PTestRec = ^TestRec;
TestRec = record
fString : AnsiString;
fInt1 : Longint;
fInt2 : Longint;
fRetAddr : Longint;
end;
function GetGroupInfoP: PTestRec;
var
s : string;
begin
new(Result);
s:=' Wr';
Result^.fString := 'Test' + s;
Result^.fRetAddr := 0;
end;
function GetGroupInfo: TestRec;
var
s : string;
begin
s:=' Wr';
Result.fString := 'Test' + s;
Result.fRetAddr := 0;
end;
function SelectGroup: TestRec;
begin
Result := GetGroupInfo;
end;
procedure p;
begin
SelectGroup;
end;
procedure destroystack;
var
s : shortstring;
p : pchar;
i : longint;
begin
for i:=0 to 255 do
s[i]:=#$90;
getmem(p,sizeof(TestRec));
for i:=0 to sizeof(TestRec)-1 do
p[i]:=#$ff;
freemem(p);
end;
var
p1 : PTestRec;
begin
destroystack;
p;
p1:=GetGroupInfoP;
dispose(p1);
end.
|