Hi,
Has anybody found and solved this issue? I would really be happy if so :)
I am running codewarrior 9.3 in ARM mode. Set a virtual parent class (pure or
not, it won't change). Then derive a child and implement the virtual method.
If the child virtual method is called from the outside of a child instance then
it's OK. But if the child calls this method from within another of its own
methods then it crashes.
I suspect virtual pointer table relocation/initialization (though I thought
this was solved with CW9.3 ?).
BTW my globals and function pointers are working fines otherwise and I do
generate relocation lists in CW project settings.
best regards,
Jim
Here is a very short illustration:
//-----------------------------------------------
class CBugVirtualParent
{
virtual void VirtualMethod() = NULL;
};
class CShowBug : CBugVirtualParent
{
public:
void VirtualMethod();
void VirtualMethodCalledFromTheInside();
};
void CShowBug::VirtualMethod()
{
}
void CShowBug::VirtualMethodCalledFromTheInside()
{
VirtualMethod();
}
... and then:
CShowBug bug;
// Calling the virtual method directly from the "outside" is OK:
bug.VirtualMethod();
// While this crashes when the child calls VirtualMethod() within:
bug.VirtualMethodCalledFromTheInside();
// Note: the same crash occurs if child calls
CBugVirtualParent::VirtualMethod() after code is changed appropriately of
course.
//-----------------------------------------------
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/