This is the mail archive of the gcc@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]

Re: malloc(0) during exception throw & catch


> >If count is zero, it will call malloc with a size of zero. This is in
> >turn called from fde_init. If you think this is a problem, please
> >submit a patch to gcc-patches@gcc.gnu.org.
> 
> There is already code in libgcc (new*) that does assume malloc(0) and
> free(NULL) are bad things.
> 
> I've been toying with a patch that would add t-fragments defines
> (HAVE_SANE_MALLOC and HAVE_SANE_FREE) to avoid those extra tests,
> since on many modern platforms, malloc(0) works, and free(NULL) as well.

This does not matter... Problem is that it is impossible or very hard to use
memory debuging tools when core libraries have such bugs inside.
 
> Would you think it a good idea to extend the patch to cover the case that's
> mentionned in this thread ?

Why not. The only thing I would like to see is that this will be turned off by default.
BTW, I've submitted a patch to gcc-patches for this problem and did not have any
reply for 2 weeks. Is this usual way of gcc team work?

-- 
Sincerely Yours,
Denis Perchine

----------------------------------
E-Mail: dyp@perchine.com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------

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