RTTI inconsistency
Jim Dehnert
dehnert at baalbek.engr.sgi.com
Wed Jan 19 06:26:35 UTC 2000
> From: Nathan Sidwell <sidwell at codesourcery.com>
>
> Hi,
> there is an inconsistency in the documentation of how a vtable
> points to the type_info object for that type.
>
> The abi layout document Run-Time Type Information (RTTI) section states,
>
> 3.Every vtable shall contain one entry pointing to an object derived
> from std::type_info. This entry is located at the word preceding
> the location pointed to by the vptr (i.e., entry "-1"). The
> entry is allocated in all vtables; for classes having virtual bases
> but no virtual functions, the entry is zero. This entry is coded
> as an offset with respect to the virtual table origin, rather than as
> a pointer (thereby avoiding run-time relocations).
This one is incorrect. I've fixed it. Thanks for the observation.
> but the closed issues document section A-6 ends by saying
> [991028 all] The current definition, in the ABI data layout document,
> has been updated with Daveed's changes, and is accepted. Note that we
> are back to using a pointer to RTTI in the vtable (see B-8)...
>
> Also the Virtual Table Layout section of the ABI document says,
> The typeinfo pointer points to the typeinfo object used for RTTI.
> All entries in each of the vtables for a given class must point to the
> same typeinfo object. A correct implementation of typeinfo equality is
> to check pointer equality.
>
> so which is it? An offset or a pointer? (I think it has to be a pointer to
> get uniqueness.)
- Jim Dehnert dehnert at sgi.com
(650)933-4272
More information about the cxx-abi-dev
mailing list