This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [csl-arm] Revise __cxa_type_match


On Wednesday 17 November 2004 10:39, Nathan Sidwell wrote:
> Paul Brook wrote:
> > + if (typeid(*catch_type) == typeid (typeid(void*)))
> > + {
> > +   const __pointer_type_info *catch_pointer_type =
> > +     static_cast<const __pointer_type_info *> (catch_type);
> > +   const __pointer_type_info *throw_pointer_type =
> > +     static_cast<const __pointer_type_info *> (throw_type);
> > +
> > +   if (typeid (*catch_pointer_type->__pointee) != typeid (void)
> > +       && (*catch_pointer_type->__pointee !=
> > +          *throw_pointer_type->__pointee))
> > +     return ctm_succeeded_with_ptr_to_base;
>
> How is this return statement reachable? If catch_type is a pointer
> to void, how can the type of the thing it points to _not_ be void?

The first if should be asserting that *catch_type is the typeid of a pointer, 
ie. a __pointer_type_info.

The second if should be asserting that it is not a pointer-to-void, and the 
two pointer types point to different things.

Did I get something wrong?

Paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]