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: PATCH: PR other/42602: demangler doesn't completely demangle a global constructors symbol


On Sat, Jan 9, 2010 at 10:42 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:

> 2010-01-09 ?H.J. Lu ?<hongjiu.lu@intel.com>
>
> ? ? ? ?PR other/42602
> ? ? ? ?* cp-demangle.c (d_make_demangle_mangled_name): New.
> ? ? ? ?(d_demangle_callback): Use it on DCT_GLOBAL_XTORS.
>
> ? ? ? ?* testsuite/demangle-expected: Updated.

> +/* Add a new demangle mangled name component. ?*/
> +
> +static struct demangle_component *
> +d_make_demangle_mangled_name (struct d_info *di, const char *s, int len)
> +{
> + ?if (d_peek_char (di) != '_' || d_peek_next_char (di) != 'Z')
> + ? ?return d_make_name (di, s, len);
> + ?d_advance (di, 2);
> + ?return d_encoding (di, 0);
> +}

Don't pass len to this function.  It should only take two parameters,
di and s.  The functoin will only work correctly when called at the
end of the name being demangled, so passing len is deceptive.  It
should just call strlen (s) in the case where it calls d_make_name.

This patch is OK with that change.

Thanks.

Ian


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