Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2000-07

Compiler problem ?

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Weustink

Hi

WHile debugging why my selectiongrabbers arent shown, I ran into the folowing problem. When running the following example, it dumps when LocalFunc is called through the THE_FUNC constant. It seems that the parent function param insn't reffered correctly.

Marc

--------------------------------------------------------

program FuncConst;
{$mode objfpc}
type
   PInteger = ^Integer;
function TestFunc(P: PInteger): Boolean;
type
   TMyFunc = function: Boolean;
   function LocalFunc: Boolean;
   begin
     Result := (P^  0);
   end;
   const
     THE_FUNC: TMyFunc = @LocalFunc;
   begin
     // Works OK
     Result := LocalFunc;
     // Dumps
     Result := THE_FUNC();
   end;
var
   X: Integer;
begin
   TestFunc(@X);
end.

Reply by email