From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17992 invoked by alias); 10 May 2006 09:06:21 -0000 Received: (qmail 17977 invoked by uid 22791); 10 May 2006 09:06:19 -0000 X-Spam-Check-By: sourceware.org Received: from py-out-1112.google.com (HELO py-out-1112.google.com) (64.233.166.177) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 10 May 2006 09:06:17 +0000 Received: by py-out-1112.google.com with SMTP id c30so2089844pyc for ; Wed, 10 May 2006 02:06:15 -0700 (PDT) Received: by 10.35.91.15 with SMTP id t15mr964773pyl; Wed, 10 May 2006 02:06:14 -0700 (PDT) Received: by 10.35.88.2 with HTTP; Wed, 10 May 2006 02:06:14 -0700 (PDT) Message-ID: <19c433eb0605100206y4bbbcbbbo535c31582ee5fcc@mail.gmail.com> Date: Wed, 10 May 2006 10:44:00 -0000 From: "=?ISO-8859-1?Q?Fran=E7ois-Xavier_Coudert?=" To: GFortran , gcc-patches Subject: [patch] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2006-05/txt/msg00383.txt.bz2 :ADDPATCH fortran: I tried to understand PR 24549 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D24549), an ICE after error recovery. We see a statement we don't understand, we skip to the next and there is the ICE, because we use a value for gfc_new_block that has been freed (it was allocated for the last statement). I don't see any reason why, in reject_statement(), we don't set gfc_new_block =3D NULL, leading to the following patch: Index: parse.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- parse.c (revision 113603) +++ parse.c (working copy) @@ -1292,7 +1292,7 @@ static void reject_statement (void) { - + gfc_new_block =3D NULL; gfc_undo_symbols (); gfc_clear_warning (); undo_new_statement (); So, I'd like to know, from someone who's accustomed to gfortran error recovery mechanism, if there is a reason for not setting clearing gfc_new_block. And, if not, is the above patch approved (I'll add a testcase and the obvious ChangeLog entries, of course). Thanks, FX PS: I know this is patch submission is not in very good order, but I'm at work and it's such a simple patch, I couldn't keep it for later.