This is the mail archive of the gcc-bugs@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: libobjc/9751: malloc of strlen, not strlen+1


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.



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