On 19 Apr 2002 at 13:18, Frank Heckenbach wrote: [...]
That's not really what it did before. What I changed was to remove a (normally) redundant VMT pointer assignment. Usually the VMT pointer is assigned when the variable is created (i.e., at program/routine start for non-pointer objects, and after memory allocation when using `New').
Until recently, GPC *also* assigned the VMT when calling a constructor which is therefore redundant (especially when calling a constructor within `New', one could see two assignments next to each other which made it clear that one was redundant).
Pardon my ignorance - but shouldn't we assign the VMT when a constructor is called? It seems that, unless this is done, one cannot guarantee that the assignment has taken place. I guess this raises another question - whether constructors should be treated as anything special, or whether they should be treated just like any other method. I believe that BP and Delphi (and, it seems, FreePascal) give special treatment to constructors, but I don't know exactly all the things that they do with constructors in order to treat them specially. But I know that if you have an object that has virtual methods but you don't first call a constructor before calling the methods, you will get a crash with all these compilers, but not with GPC.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~African_Chief email: African_Chief@bigfoot.com