Crash when "procedure of object" variable is set to address of virtual method, if object has data fields.
Original Reporter info from Mantis: pcode@mail.ru
-
Reporter name: --
Original Reporter info from Mantis: pcode@mail.ru
- Reporter name: --
Description:
For dynamic objects created using new( ptr, constructor ) or ptr = getmem, ptr^.contstructor
Steps to reproduce:
// compile and run this code
// compiler options -l -Mobjfpc -Sh -a -gl
type tx = object
a,b,c: longint; // remove these => no crash
constructor init;
procedure v; virtual;
end;
px = ^tx;
constructor tx.init;
begin
end;
procedure tx.v;
begin
end;
var t : procedure of object;
p : px;
begin
new( p, init );
p^.v; // ok
t := @p^.v; // sigsegv
end.
Mantis conversion info:
- Mantis ID: 17521
- OS: windows
- OS Build: NT5
- Platform: intel32
- Version: 2.4.0
- Fixed in version: 2.6.0
- Fixed in revision: 16190 (#dd8fd7cd)
- Monitored by: » pcode@mail.ru (--)