Re: [PATCH] Fix selftest::read_file for empty file

2017-07-19 Thread Jakub Jelinek
On Wed, Jul 19, 2017 at 04:54:31PM +0200, Marek Polacek wrote: > > --- a/gcc/selftest.c > > +++ b/gcc/selftest.c > > @@ -192,7 +192,14 @@ read_file (const location &loc, const char *path) > >fclose (f_in); > > > >/* 0-terminate the buffer. */ > > + if (total_sz == 0) > > +{ > > +

Re: [PATCH] Fix selftest::read_file for empty file

2017-07-19 Thread Marek Polacek
On Wed, Jul 19, 2017 at 10:49:33AM -0400, David Malcolm wrote: > selftest::read_file currently assumes it has a non-empty file; > when loading an empty file it dies with an assertion failure, > or a write through NULL if assertions are disabled. > > This patch fixes this case, removing this limita

Re: [PATCH] Fix selftest::read_file for empty file

2017-07-19 Thread Jeff Law
On 07/19/2017 08:49 AM, David Malcolm wrote: > selftest::read_file currently assumes it has a non-empty file; > when loading an empty file it dies with an assertion failure, > or a write through NULL if assertions are disabled. > > This patch fixes this case, removing this limitation. > > Success