This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: [patch, fortran] Always return malloc(1) for empty arrays in the library


Hi Janne,

I'd prefer to add the zero check to runtime/memory.c
(internal_malloc_size), i.e. change

if (size == 0)
   return NULL;

to

if (size == 0)
   size = 1;


Good point. I have done so in the attached patch, plus removed all special cases for checking for zero size.

Regression-tested. OK for trunk?

For 4.6, I would just commit the change to internal_malloc_size
(which would also fix PR 49479), plus the test case for that
PR.

OK?

Regards

Thomas


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