[C++ PATCH] Fix rtti ICE (4.1 regression, PR c++/23947)

Nathan Sidwell nathan@codesourcery.com
Tue Sep 20 11:29:00 GMT 2005


Jakub Jelinek wrote:
> Hi!
> 
> Since Nathan's 2005-06-15 rtti patch the following testcase crashes
> on HEAD.
> The problem is that in some cases the tinfo_descs vector is reallocated,
> but get_pseudo_ti_init keeps holding pointers into the old array, which
> in case of luck might be the same, but without luck can contain garbage
> as well.  I have spotted just two places where a tinfo_s * pointer
> into the tinfo_descs vector can be live accross reallocation,
> which can happen when calling get_tinfo_ptr via.
> get_tinfo_decl/get_pseudo_ti_index.
> Ok for HEAD if bootstrap/regtesting succeeds (just started)?
yeah, thanks Jakub.

> Alternatively, rtti.c could stop passing around tinfo_s *
> pointers and pass indexes into the tinfo_descs vector instead
> and just use VEC_index (tinfo_s, tinfo_descs, xx) immediately
> before each use.
yup, but we might as well go with the patch you're testing now :)

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk



More information about the Gcc-patches mailing list