https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118927

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Nate Eldredge from comment #6)
> After some brief digging, it seems like the problem is that
> `cxx_printable_name_internal` can be called recursively by `lang_decl_name'
> (via `announce_function').  This is bad because, with its static ring
> buffer, it's not reentrant.  In particular, at the site of the call to
> `lang_decl_name`
> (https://github.com/gcc-mirror/gcc/blame/
> 427386042f056a2910882bf0c632b4db68c52bbb/gcc/cp/tree.cc#L2770), the ring
> buffer is in an inconsistent state, as one of its entries has just been
> freed but not marked as invalid.  So a recursive call may think that entry
> is valid, and decide to free it again to make room for a new one.

In normal running there should be tsubst should NOT be called from
cxx_printable_name_internal . So the problem is NOT the ring buffer but rather
the call before hand.

Reply via email to