The attached code crashes.
It presents a hierarchy of 3 classes with a virtual inheritance. It crashes when calling mlocal() (a virtual method) from f() (an another virtual method) when f() is called through the base class CIV (CIV is a base "virtually inherited") . The two std::cerr don't do anything and can be removed.
Take note that method f() returns a CDataRet and if you change the fields of this class it may stop crashing (for example removing long d_l or double d_d from the class declaration).
If CInst doesn't inherit virtually from CIV it doesn't crash
If CCom has no virtual table it doesn't crash
If I compile with -fno-rtti and -fno-exceptions it is still crashing
My system's target is i686-w64-mingw32
It crashes with rubenvb-4.7.2-release and rubenvb-4.7.1-release and with fedora crosscompiler (i.e. gcc 4.7.0).
On linux I have no issue with any gcc version.
It works also with tdm-4.6.1 tdm-4.5.3 and tdm-4.4.0
I hope I have reduced the code enough so it helps you.
Log in to post a comment.