I'm maintaining an old product based on MCF5208, I found some code behavior is strange, so I wrote a simple test code to do test. I think I found a compiler bug when using C++ virtual function.
virtual int Size()=0;
class B:public A
virtual int Size()
static B b;
A *p = &b;
int x = b.Size();
int y= p->Size();
When code run to p->Size(); it will crash.
I have decompiled the code and run it in step mode, I found it crashed in the line I marked red.
Is this a real problem or it just because of some incorrect compiler settings?