[cxx-abi-dev] Problem with vcall offsets

Jason Merrill jason at redhat.com
Tue Jul 2 18:32:25 UTC 2002


>>>>> "Mark" == Mark Mitchell <mark at codesourcery.com> writes:

> In other words, the vtable for A, when used as a virtual base is:

>    A's vcall offset for A::a
>    A's vbase offset to P
>    P's vcall offset for P::p
>    P's vbase offset to V
>    V's vcall offset for V::v
>    Offset-to-top
>    Typeinfo 
>    Entry for V::v
>    Entry for P::p
>    Entry for A::a

Looks right to me.

> This cannot possibly be right.  If you want to be able to generate
> code to cast from an A* to a P*, then the index of A's vbase offset
> for P must be constant; it cannot depend on whether or not A itself is
> a virtual base in something else.

I don't follow.  The only difference I see is that if A isn't a virtual
base, the vcall entry for A::a isn't there.  The vbase offset doesn't move.
The vcall offset for P::p is always there because P is a virtual base.

Jason



More information about the cxx-abi-dev mailing list