This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35483] GCC on AIX doesn't support dollar in symbols name.
- From: "dje at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Oct 2008 21:30:24 -0000
- Subject: [Bug c++/35483] GCC on AIX doesn't support dollar in symbols name.
- References: <bug-35483-15867@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from dje at gcc dot gnu dot org 2008-10-02 21:30 -------
+ strip = (char *)ggc_alloc_string (name, len);
+
+ for (len = 0; name[len]; len++)
+ if (name[len] == '$')
+ strip[len] = '_';
+ else
+ strip[len] = name[len];
+ strip[len] = 0;
+
+ return strip;
It is not safe to edit a ggc_alloc_string-allocated string in place. This
should be
+ strip = (char *)alloca (name, len);
...
+ return ggc_alloc_string (strip, len);
Also, using fixed-size 256 byte buffers is not safe because they can overflow.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35483