This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Library ABI seriously broken!!
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: Jerry Quinn <jlquinn at optonline dot net>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, "libstdc++" <libstdc++ at gcc dot gnu dot org>, jason at redhat dot com
- Date: Fri, 30 Oct 2009 14:09:37 +0100
- Subject: Re: Library ABI seriously broken!!
- References: <4AEAD273.7050908@oracle.com> <1256905677.31256.1479.camel@cerberus.qb5.org> <4AEAE1E8.9000904@oracle.com>
On Fri, Oct 30, 2009 at 1:54 PM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> Jerry Quinn wrote:
>> I've reverted the patch.
>>
> Thanks Jerry for your quick feedback.
I think it was just
static tree
-tinfo_name (tree type)
+tinfo_name (tree type, bool mark_private)
{
const char *name;
+ int length;
tree name_string;
- name = mangle_type_string_for_rtti (type);
- name_string = fix_string_type (build_string (strlen (name) + 1, name));
- return name_string;
+ name = mangle_type_string (type);
+ length = strlen (name);
+
+ if (mark_private)
+ {
+ /* Inject '*' at beginning of name to force pointer comparison. */
+ char* buf = (char*) XALLOCAVEC (char, length + 1);
+ buf[0] = '*';
+ memcpy (buf + 1, name, length);
+ name_string = build_string (length + 1, buf);
+ }
+ else
+ name_string = build_string (length, name);
+
+ return fix_string_type (name_string);
where you replaced build_string (strlen (name) + 1, name) with
build_string (strlen (name), name). I don't know if this renders the
ABIs incompatible, but I doubt it - it would be nice to verify that indeed
just extra '\0's are now missing at the end.
Richard.
> Paolo.
>