c++/5390: Libiberty fails to demangle multi-digit template parameters.

Carlo Wood carlo@alinoe.com
Sat Mar 8 00:41:00 GMT 2003


On Fri, Mar 07, 2003 at 12:18:18PM -0500, DJ Delorie wrote:
> Vlad reported a core dump.

I think I was the one who first reported the core dump, perhaps
he reported it for me because I reported it to the wrong group
(probably libstdc++).

> Nick fixed it with a small patch.  You also wrote a significantly
> larger patch also claiming to fix it.

If I remember correctly - it was literally admitted that the small
patch fixed the core dump but not the real problem / demangler.

> You were asked if you tested on older gcc's to ensure backward
> compatibility.  You said you didn't.

That is not true - I said that it is impossible to support both
the mangling of 2.95 and the mangling of pre-2.95 (they are ambigious)
and suggested to support the latest (then still pretty current) version
instead of persuing backwards compatibility at the cost of breaking
the functionality for a LATER version.

> The issue of backward
> compatibility was never resolved to my satisfaction, so I didn't
> approve it.

I am afraid I could not have been more clear than I have been.
>From what I remember, someone (you?) mentioned backwards compatibility
and then I explained why that was impossible (see above).

> I also noted that the demanglers are normally maintained
> by the C++ folks, but apparently you didn't convince them either.

I am currently the author and maintainer of the new ABI demangler.
I was asked for that by the C++ folks.  Moreover:

> However, if you look in libiberty's ChangeLog, you'll see that your
> patch was eventually applied, over a year ago.  So, I'm not sure what
> you're complaining about.
> 
> 2002-02-18  Carlo Wood  <carlo@gnu.org>
> 
> 	PR c++/5390
> 	* cplus-dem.c (demangle_integral_value): Accept multi-digit
> 	numbers that do not start with an underscore; This is needed
> 	for integer template parameters. This doesn't break anything
> 	because multi-digit numbers are never followed by a digit.
> 	* testsuite/demangle-expected: Corrected all mangled test
> 	cases with multi-digit template parameters: g++ 2.95.x does
> 	not generate underscores around these parameters.

Then it was applied in a wrong way (and without notifying me, or I'd
have tested it and complained) - if I compare the current source
code of cplus-dem.c with the patch that I supplied then only parts
were applied.  It seems to me, that something majorly went wrong
during the applying of the patch - or someone "fixed" it without
testing it and/or understanding it. 

But - you are right that I should not have complained in this
particular instance as it appears that this patch was at least
considered a year or so after I supplied it.  On the other hand,
it was never my intention to complain, I just wanted to say that
I will not put time into fixing cplus-dem.c this time and explained
why.  I am sorry if I sounded bitter.

-- 
Carlo Wood <carlo@alinoe.com>



More information about the Gcc-bugs mailing list