From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14572 invoked by alias); 24 Jan 2014 02:58:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 14555 invoked by uid 89); 24 Jan 2014 02:58:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-HELO: dub0-omc4-s24.dub0.hotmail.com Received: from dub0-omc4-s24.dub0.hotmail.com (HELO dub0-omc4-s24.dub0.hotmail.com) (157.55.2.99) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 24 Jan 2014 02:58:35 +0000 Received: from DUB129-W70 ([157.55.2.71]) by dub0-omc4-s24.dub0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 23 Jan 2014 18:58:32 -0800 X-TMN: [T4hzJ4fBFxih7ldajtWhR6ak78bu4a7a] Message-ID: From: Bernd Edlinger To: Jakub Jelinek , Dodji Seketeli CC: GCC Patches , Tom Tromey , =?iso-8859-1?B?TWFudWVsIEzzcGV6LUli4fFleg==?= Subject: RE: [PATCH] preprocessor/58580 - preprocessor goes OOM with warning for zero literals Date: Fri, 24 Jan 2014 02:58:00 -0000 In-Reply-To: <20140123171245.GK892@tucnak.redhat.com> References: <87y559xz7y.fsf@redhat.com>,<20131031173649.GW27813@tucnak.zalov.cz>,<87zjpbb5qu.fsf@redhat.com>,<20131111142159.GZ27813@tucnak.zalov.cz>,<878uwuap4f.fsf@redhat.com>,<878uwt63e2.fsf@redhat.com>,<20131113081610.GH27813@tucnak.zalov.cz>,<87zjp7t73c.fsf@redhat.com>,,<87vbxcig8t.fsf@redhat.com>,<20140123171245.GK892@tucnak.redhat.com> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2014-01/txt/msg01561.txt.bz2 Hi, On Thu, 23 Jan 2014 18:12:45, Jakub Jelinek wrote: >=20 > On Wed, Jan 22, 2014 at 09:16:02AM +0100, Dodji Seketeli wrote: >> +static fcache* >> +add_file_to_cache_tab (const char *file_path) >> +{ >> + >> + FILE *fp =3D fopen (file_path, "r"); >> + if (ferror (fp)) >> + { >> + fclose (fp); >> + return NULL; >> + } >=20 > I've seen various segfaults here when playing with preprocessed sources > from PRs (obviously don't have the original source files). > When fopen fails, it just returns NULL, so I don't see why you just don't > do > if (fp =3D=3D NULL) > return fp; >=20 > Jakub This would be a good idea for test cases too. However the test system always calls the compiler with -fno-diagnostics-show-caret so I doubt your test case is actually testing anything when it is called from the test environment with that option. Bernd.=20=09=09=20=09=20=20=20=09=09=20=20