This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[fortran,patch] Fix PR 25252, error-recovery and ice-on-invalid
- From: FX Coudert <fxcoudert at gmail dot com>
- To: "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 16:33:44 +0000
- Subject: [fortran,patch] Fix PR 25252, error-recovery and ice-on-invalid
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:to:message-id:content-type:from:subject:date:x-mailer; bh=njCK/+JRMPeyfTVEuHmvFmdC043gTya+O7NSQfPAFpw=; b=CCtFO2EbItn7yhQWdoApzTD8whubaj7ynzo+1YwQMqtC3zjzIUBE9KpX8DWSWSxylrhhN5qn/OXd+DXRLf7YXlvJYaoAn3beudLR5OKOYnsMTOv0PdnMQfNNK6I8eb7VhtpsbtffOcc+/LFw0gi0T0Mi1H1QEAkvtKTg/hpzLlU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:to:message-id:content-type:from:subject:date:x-mailer; b=kg92Ieud/7Hbwc6f9OXofaF5RZQcITOTAnNdNFp8eNxCZ3XY0AWxAEFD51Hkxk4+yto80IGY/eQAfqxaRS/p2X9qQ3fgo3I7auopYyTfJY5/tVXKXUgNgZw8IgSvgrq9+DVmU2Un9QBZ/y+KAvQdS6+mCEPpA2yswfYoRlCP2OI=
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:
Attachment:
pr25252.ChangeLog
Description: Binary data
Attachment:
pr25252.diff
Description: Binary data