------- 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