Hi all,
I have some problems with WPO. When the unit in the attached example is compiled for the third time, the compiler crashes while writing the WPO-information to the ppu.
This is because the a tobjectdef which has been added to the WPO-list with classes which are created has been freed.
I am not sure what happens exactly, and I was not able to generate a simpler example. But my guess is that there is a method in which an instance of the class is created. Then there are no calls to this method so the method is removed. (and with this method the it's symtable with the type-definition. This is the part that I do not really understand) The reference to the type is still in the WPO-table, so when it is written to file, the system collapses.
The attached patch fixes the problem, but I doubt that the fix is correct. (Especially when a class is created in multiple places. My patch will remove the classtype from the list with created classes, regardless the count.)
Besides that, I just discovered that the patch breaks cycling of the compiler. But it is wrong anyway...
Can someone help me out?
Regards,
Joost.
