This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH] preprocessor/58580 - preprocessor goes OOM with warning for zero literals
- From: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Dodji Seketeli <dodji at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 4 Nov 2013 13:15:09 +0100
- Subject: RE: [PATCH] preprocessor/58580 - preprocessor goes OOM with warning for zero literals
- Authentication-results: sourceware.org; auth=none
- References: <DUB122-W32B887B9B78C252A2B9146E40B0 at phx dot gbl>,<20131031144309 dot GR27813 at tucnak dot zalov dot cz>,<87y559xz7y dot fsf at redhat dot com>,<20131031173649 dot GW27813 at tucnak dot zalov dot cz>,<87r4awtmnx dot fsf at redhat dot com>,<DUB122-W28CED038DC226BBF745368E4F60 at phx dot gbl>,<20131104120636 dot GP27813 at tucnak dot zalov dot cz>
>
> On Mon, Nov 04, 2013 at 12:59:49PM +0100, Bernd Edlinger wrote:
>> I see another "read_line" at gcov.c, which seems to be a copy.
>
> Copy of what? gcov.c read_line hardly can be allowed to fail because out of
> mem unlike this one for caret diagnostics.
> Though, surely, this one could be somewhat adjusted so that it really
> doesn't use a temporary buffer but reads directly into the initially
> malloced, then realloced, buffer. But, if we want it to eventually switch
> to caching the caret diagnostics, it won't be possible/desirable anymore.
>
> Jakub
gcov.c and input.c currently both have a static function "read_line"
they are currently 100% in sync. Both _can_ fail, if the file gets
deleted or modified while the function executes.
If gcov.c crashes in that event, I'd call it a bug.
Bernd.