libobjc/9751: malloc of strlen, not strlen+1

Richard Frith-Macdonald richard@brainstorm.co.uk
Mon May 12 09:14:00 GMT 2003


http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9751

I was just looking at this ... and I don't think this is a bug.
If I understand the code correctly, it is removing a single byte (the 
garbage collecting invisibility marker) from the type string.  So the 
length of the new string is one byte less than that of the original.
So allocating strlen(ivar->ivar_type) bytes is correct.
It might perhaps be worth adding a comment to thiks effect in the source 
though.



More information about the Gcc-bugs mailing list