Hello, I found out that, unfortunately, the newest GPC has a changed processing of constructors. As far as I know, even the virtual methods should be identified in the compilation time in the sense, that when calling a constructor for an object (for example one with destroyed layout) the methods are called inside the constructor the static way. GPC 20020410 causes segmentation fault when I try to call a constructor (and a virtual method inside) on an object which was FillChar'ed (obviously, the same is the case when we use a pointer to an array of objects created by GetMem). See the test program below: program tester; type t=object procedure proc;virtual; constructor Init; end; procedure t.proc; begin writeln('Proc'); end; constructor t.init; begin writeln('Init'); proc; end; var p:array[0..10] of t; begin fillchar(p,sizeof(p),0); p[1].Init; end. I assume, there was some optimalization added to call the virtual methods really the virtual way. Or maybe the constructor creates the VMTP at the end of the constructor process. Is there a chance to get the previous behavior back ? Regards, Adam Naumowicz -------------------------------------- WWW: http://math.uwb.edu.pl/~adamn/ --------------------------------------
participants (5)
-
Adam Naumowicz -
Frank Heckenbach -
marcov@stack.nl -
Maurice Lombardi -
Prof Abimbola Olowofoyeku