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


In article <200005281058.MAA05095@loewis.home.cs.tu-berlin.de> you write:
>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.

Would you think it a good idea to extend the patch to cover the case that's
mentionned in this thread ?


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