This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] libiberty: Initialize d_printing in all cplus_demangle_* functions.
- From: Mark Wielaard <mark at klomp dot org>
- To: Markus Trippelsdorf <markus at trippelsdorf dot de>
- Cc: gcc-patches at gcc dot gnu dot org, Nathan Sidwell <nathan at acm dot org>, Ian Lance Taylor <iant at google dot com>, Pedro Alves <palves at redhat dot com>, Nick Clifton <nickc at redhat dot com>
- Date: Mon, 13 Mar 2017 19:29:59 +0100
- Subject: Re: [PATCH] libiberty: Initialize d_printing in all cplus_demangle_* functions.
- Authentication-results: sourceware.org; auth=none
- References: <1489356354-27648-1-git-send-email-mark@klomp.org> <20170313181150.GA287@x4>
On Mon, Mar 13, 2017 at 07:11:50PM +0100, Markus Trippelsdorf wrote:
> On 2017.03.12 at 23:05 +0100, Mark Wielaard wrote:
> > While integrating the d_printing recursion guard change into gdb I
> > noticed we forgot to initialize the demangle_component d_printing
> > field in cplus_demangle_fill_{name,extended_operator,ctor,dtor}.
> > As is done in cplus_demangle_fill_{component,builtin_type,operator}.
> > It happened to work because in gcc all demangle_components were
> > allocated through d_make_empty. But gdb has its own allocation
> > mechanism (as might other users).
>
> Nick has synced the binutils-gdb repro with gcc's.
> I think you should commit your fix as obvious.
Ian just approved it and I checked it in. gcc svn r246105.
> And it would be nice if Nick could sync again, after your patch went in.
O, sorry. I should have let Nick known about the gdb regressions I found.
Besides this patch gdb needs the following one-liner fix:
diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y
index fd1e949..5278c05 100644
--- a/gdb/cp-name-parser.y
+++ b/gdb/cp-name-parser.y
@@ -201,6 +201,7 @@ make_empty (enum demangle_component_type d_type)
{
struct demangle_component *ret = d_grab ();
ret->type = d_type;
+ ret->d_printing = 0;
return ret;
}
Cheers,
Mark