This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [fortran,patch] Fix PR 25252, error-recovery and ice-on-invalid
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: FX Coudert <fxcoudert at gmail dot com>
- Cc: "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>, gcc-patches list <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 17 Nov 2007 09:36:40 -0800
- Subject: Re: [fortran,patch] Fix PR 25252, error-recovery and ice-on-invalid
- References: <B3F3B88A-7B0A-4C06-8ACB-5BA5A40F4AC7@gmail.com>
FX Coudert wrote:
Attached patch fixes PR 25252, which is in fact two error-recovery and
ice-on-invalid bugs in gfc_match_modproc(), the function that matches
module procedure statements. The first part is to move the check for
syntax error earlier in the loop. The second part is the recovery part:
when we have a syntax error after having succesfully emitted code for
some symbols (like "module procedure foo, bar, not => allowed"), we used
to no remove the already created symbols (foo and bar) from the
interface, even though the symbols will be cleaned up in
reject_statement(). Thus, the interface's sym->interface.generic (if
it's a generic interface, e.g.) was left with pointers to cleaned up
memory. I counter this by resetting the interface to its previous state
(creating two auxiliary functions in interface.c to help), and freeing
the allocated gfc_interface's.
Bootstrapped and regtested on x86_64-linux, OK to commit?
FX
:ADDPATCH fortran:
This OK, very clean.
Jerry