fpc/tests/webtbs/uw18121.pp
Jonas Maebe caea5ac8be * record a load node for the self/vmt tree of the current routine in the
tcallnode constructor, so that when it's needed later during pass 1,
    its value doesn't depend on the context in which pass 1 is executed
    (e.g. when inlining) (mantis #18121)

git-svn-id: trunk@30908 -
2015-05-25 12:55:40 +00:00

56 lines
759 B
ObjectPascal

unit uw18121;
{$inline on}
interface
{$mode objfpc}{$H+}
uses
SysUtils;
type
{ T1 }
TPointerList = class
private
i: Pointer;
procedure SetF(v: Pointer);
function GetF: Pointer;
end;
{ TPointerList2 }
TPointerList2 = class(TPointerList)
public
procedure SetF(v: PInteger); inline;
procedure WriteLn;
end;
implementation
procedure TPointerList.SetF(v: Pointer);
begin
i := v;
end;
function TPointerList.GetF: Pointer;
begin
Result := i;
end;
{ TPointerList2 }
procedure TPointerList2.SetF(v: PInteger); inline;
begin
inherited SetF(Pointer(v));
end;
procedure TPointerList2.WriteLn;
var
S: string;
begin
S := Format('%P', [i]);
System.WriteLn(S);
end;
end.