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


> > Thanks for your bug report. You did not mention what platform you are
> > using, so it is hard to reproduce the problem. I could not reproduce
> > it on i586-pc-linux-gnu, with gcc 2.95.2.
> 
> gcc-2.95.2. i686-linux. 2.2.15.
[...]
> And use for example YAMD (http://www3.hmc.edu/~neldredge/yamd/)

Ok. I think I found the cause, it is in gcc/frame.c

static inline void
start_fde_sort (fde_accumulator *accu, size_t count)
{
  accu->linear.array = (fde **) malloc (sizeof (fde *) * count);
  accu->erratic.array = (fde **) malloc (sizeof (fde *) * count);
  accu->linear.count = 0;
  accu->erratic.count = 0;
}

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.

Regards,
Martin

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