[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: virtual table off by three problem
From: |
Marc Brett |
Subject: |
Re: virtual table off by three problem |
Date: |
12 Feb 2002 11:42:14 GMT |
User-agent: |
tin/pre-1.4-19990216 ("Styrofoam") (UNIX) (IRIX/6.5 (IP22)) |
Me too.
We're getting the same behaviour with g++ 2.95.2 and Redhat 6.2,
SGI workstation with single processor Pentium III.
Trying to recompile with g++ 3.0.2, but this may take some time.
Would be interested to hear if you make any progress.
Aubrey Holland <address@hidden> wrote:
> In one of my libraries, I have a rather deep inheritance tree where
> the classes in this tree contain quite a few virtual functions. I
> have noticed recently that there seems to be a problem with the
> virtual tables that get created for some of these classes.
> Specifically, when I try to call one of the virtual methods in this
> class, the result is that I get a call to the virtual method that is
> three virtual methods down in the header file. I.e. in the following
> overly-simplified example, a call to a() would result in d() actually
> being called. This happens regardless of where I place the function
> in the header file... the third one down is always called.
> class example
> {
> virtual void a();
> void nonvirtual();
> virtual void b();
> virtual void c();
> virtual void d();
> };
> I saw the following previous similar posting, but it seems to indicate
> the the bug is already fixed:
> http://groups.google.com/groups?q=g%2B%2B+virtual+table+off+by&hl=en&selm=Pine.OSF.3.91j.950911160602.5228N-100000%40saul6.u.washington.edu&rnum=3
> I'm working on trying to reproduce this in a smaller, more portable
> example program but haven't had much luck as of yet.
> Sysyem info:
> Dual processor Dell Workstation, running Pentium Xeon processors.
> RedHat 7.2
> gcc and g++ 2.96-98
> TIA,
> Aubrey Holland
--
Marc Brett +44 20 8560 3160 WesternGeco
address@hidden 455 London Road, Isleworth
ICBM: TQ 15774 76378 (OSGB) Middlesex TW7 5AA UK