Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
fpc-src / usr / share / fpcsrc / 3.0.0 / tests / webtbs / tw17521.pp
Size: Mime:
{$mode objfpc}
{$h+}


type tx = object
       a,b,c: longint; // remove these => no crash
       constructor init;
       function v: longint; virtual;
       end;
     px = ^tx;
     
constructor tx.init;
  begin
  end;

function tx.v: longint;
  begin
    v:=b;
  end;
  
var t : function:longint of object;
    p : px;
    
begin
  new( p, init );
  p^.a:=3;
  p^.b:=4;
  p^.c:=5;
  p^.v; // ok
  t := @p^.v; // sigsegv
  if t()<>4 then
    halt(1);
end.