newton%cadillac.cad.mcc.com@mcc.com (Dave Newton) (01/18/90)
/*
Michael,
The following bug appears to be related to the bugs we
have sent to you in the last couple of days. We urgently
need a fix as we currently dead in the water, with few
if any work arounds. Even going back to 1.36.2.z is not
a good option for us now. Hope you can track this down
quickly.
Thanks Dave Newton.
Sun3(4.02)
[1.305]suntrek) g++-1.36.3 -v -g -O -o virtual virtual.cc
g++ version 1.36.3 (based on GCC 1.36.92)
/usr/local/gnu/1.36.3/lib/gcc-cpp -+ -v -undef -D__GNUC__ -D__GNUG__ -D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__OPTIMIZE__ -D__HAVE_68881__ -Dmc68020 virtual.cc /usr/tmp/cca01998.cpp
GNU CPP version 1.36.92
/usr/local/gnu/1.36.3/lib/gcc-cc1plus /usr/tmp/cca01998.cpp -quiet -dumpbase virtual.cc -g -O -version -o /usr/tmp/cca01998.s
GNU C++ version 1.36.3 (based on GCC 1.36.92) (68k, MIT syntax) compiled by GNU C version 1.36.92.
default target switches: -m68020 -mc68020 -m68881 -mbitfield
/usr/local/gnu/1.36.3/lib/gcc-as -mc68020 -o virtual.o /usr/tmp/cca01998.s
/usr/local/gnu/1.36.3/lib/gcc-ld -o virtual -e start -dc -dp -Bstatic /lib/crt0.o /lib/Mcrt1.o virtual.o -lg++ /usr/local/gnu/1.36.3/lib/gcc-gnulib -lg -lc -lg -L/usr/lib/f68881
[1.306]suntrek) virtual
Segmentation fault
[1.307]suntrek)
*/
#include <stream.h>
class A {
public:
A() {}
virtual const char* isA() const {return "A";}
};
class B : public A {
public:
B() {}
const char* isA() const {return "B";}
};
class C : public B {
public:
C() {}
const char* isA() const {return "C";}
};
class D {
public:
D() {}
};
class E : public D, public C {
public:
E(int i) {}
const char* isA() const {return "E";}
};
main() {
E* e = new E(10);
e->isA(); // Run time Segv's
/* gdb output
Program received signal 11, Segmentation fault
Reading in symbols for virtual.cc...Internal error: type offset non-zero in lookup_basetype_typevirtual function table field not found
gdb internal error: free: Called with bad argument
Quit
*/
}